From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FE0BC77B7C for ; Thu, 11 May 2023 20:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239266AbjEKUQw (ORCPT ); Thu, 11 May 2023 16:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238053AbjEKUQv (ORCPT ); Thu, 11 May 2023 16:16:51 -0400 X-Greylist: delayed 378 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 11 May 2023 13:16:48 PDT Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CD9E76; Thu, 11 May 2023 13:16:47 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id C65682800B3CA; Thu, 11 May 2023 22:10:25 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id B8BDE23C8; Thu, 11 May 2023 22:10:25 +0200 (CEST) Date: Thu, 11 May 2023 22:10:25 +0200 From: Lukas Wunner To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Heiner Kallweit , linux-pci@vger.kernel.org, Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Krzysztof Wilczy?ski , nic_swsd@realtek.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Netdev , LKML Subject: Re: [PATCH 14/17] r8169: Use pcie_lnkctl_clear_and_set() for changing LNKCTL Message-ID: <20230511201025.GC31598@wunner.de> References: <20230511131441.45704-1-ilpo.jarvinen@linux.intel.com> <20230511131441.45704-15-ilpo.jarvinen@linux.intel.com> <98b3b70a-86c0-78c0-b734-0764bb5a21fc@gmail.com> <985b617-c5d7-dce3-318b-f2f8412beed3@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <985b617-c5d7-dce3-318b-f2f8412beed3@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 11, 2023 at 11:00:02PM +0300, Ilpo Järvinen wrote: > On Thu, 11 May 2023, Heiner Kallweit wrote: > > On 11.05.2023 15:14, Ilpo Järvinen wrote: > > > Don't assume that only the driver would be accessing LNKCTL. ASPM > > > policy changes can trigger write to LNKCTL outside of driver's control. > > > > > > Use pcie_lnkctl_clear_and_set() which does proper locking to avoid > > > losing concurrent updates to the register value. > > > > > > > Wouldn't it be more appropriate to add proper locking to the > > underlying pcie_capability_clear_and_set_word()? > > As per discussion for the other patch, that's where this series is now > aiming to in v2. That discussion wasn't cc'ed to Heiner. For reference, this is the message Ilpo is referring to: https://lore.kernel.org/linux-pci/ZF1AjOKDVlbNFJPK@bhelgaas/