From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.85.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796237471; b=qqu4PCr2D6wh0tQtlqNr7oDonrVKruUZ979VkbePqtjqTnu4stLb5PH2PC3H/B1DuQGS 7QY7asMu/oW4LG7epteN14wIw4+Q7yeHno+cLkD85eo8iMGvFM/yEdUUqy6DvU53ag8vh jld1otDx8eNlvPejy5ez46vuWq9qIb336wcr1kayAsOOz8dh0AgL5hBmZmVzME/jQ1D70 fVTb0rILAJMRaoFuF0O0LSuClPLu2g6nxFT6oKSm7nhMA6vVIrIn4ykb/sxDDf84bQJ/0 8DVvcdtTVAKxgoJDsfT2khM1xm6Iu/5HfKzTIZetY7rkUYI+3cGeflQj15zDcetDevQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796237471; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-Last-TLS-Session-Version; bh=Byhb6aYwjU1Eta6Ev+FXdXFJkPQFOHMKmPKfug4EaIY=; b=tUYlg+SKlWIT7H1sc9xTTu+IxI/RRuTcHVAYolGPuFIHfstAghbuFtNa0L92kcgr8Kqx Z4QOV5P6N6/tiCOtGX6ya9XKKGhYP+Ra+zs56cQGlmtbZLtU+QNLyTKBykukJcrU3axs7 h/96LgNidWwFx8AT366LiHTi2SboZrKIw9EyELOuemUerXG+WciYhLTp0Tc109l2uAKnh 0ybyOjxiuGXjEDSI9i6ZB6bjQUlS9OFUdJEi1Y2VIA2DZC/orjrUCX87VTD7xPNVIxVl4 H+iWrZ+6dlfwoDNcZypOa/y4U/tvQbi/ZXLcSOROwoalXOi51lWopyDjdZnjagg/7fA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=YB6U4+qk; arc=none smtp.remote-ip=185.246.85.4 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A114C606A33F for ; Wed, 2 Dec 2026 18:51:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A114C606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=YB6U4+qk Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id EE8604E4184E; Wed, 2 Dec 2026 18:51:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B314D6075F; Wed, 2 Dec 2026 18:51:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9E51711EA05CD; Wed, 02 Dec 2026 19:50:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796237463; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=Byhb6aYwjU1Eta6Ev+FXdXFJkPQFOHMKmPKfug4EaIY=; b=YB6U4+qk0n8STnyOs4RYtB0Z1hX83e6I+A6uswaWet58zAB9RxEoy8HEnBsLURs4TlMvtQ +Sr439ilBDbS07LlGpXqrIkS/afbXaoaW4V4ruyd5+YxLzE4mWrb3LPPl/vC3qXK2Py1Zn GWEWFH0pTp3hcXm+bcnr7wTaTwZNknDcMZ4DjBpMlk6h0FMAQhEH2CAJ9hW3fgLd2yanMB A01Ai6q02sPTf9u6Cx0H1jnasndHZ+Fo8IAXLTVJyzjuqA4no3FB8Fh6QrxBCTXunVWz5x 30LcFeY6VIrHT72S2/ne3sEKU9hNLeNtB7xtcmZZMKuvnY9C9T54qI/Uhx1Bmw== Message-ID: <84a0c06b-134d-44be-865e-dc7c8d072b4a@bootlin.com> Date: Wed, 2 Dec 2026 19:50:56 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume To: arina.kharlamova@mbzuai.ac.ae, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Bjorn Helgaas , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Philipp Stanner Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org References: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi, On 12/1/26 20:14, Arina Kharlamova via B4 Relay wrote: > From: Arina Kharlamova > > intel_eth_pci_resume() calls pcim_enable_device() although the device > is enabled in probe and intel_eth_pci_suspend() does not disable it. > Since commit 77f79ac8de0f ("PCI: Remove struct pci_devres.enabled > status bit") each call raises the enable count. Since commit > f748a07a0b64 ("PCI: Remove legacy pcim_release()") each call also adds > a pcim_disable_device() devres action. Both pile up with every > suspend and resume until the device is unbound. The call does not > touch the hardware, because the enable count is already above zero > there. > > The device stays enabled across suspend, so drop the call. > > Fixes: 77f79ac8de0f ("PCI: Remove struct pci_devres.enabled status bit") > Fixes: f748a07a0b64 ("PCI: Remove legacy pcim_release()") > Signed-off-by: Arina Kharlamova > --- > I found this while checking the other drivers that call > pcim_enable_device() again on resume, after the discussion of the t7xx > fix: > https://lore.kernel.org/all/20261201-s2p-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae/ > > With the help of an AI coding assistant (Claude); I reviewed the > analysis and the fix. Not triggered at runtime. Compile-tested only, > not tested on hardware. I _think_ this is correct with my limited PCI knowledge, however can you audit as well the stmmac_pci_plat_resume() call ? [0] It does the same thing but with pci_enable_device instead of pcim_enable_device(), and maybe the right way is to get the generic stmmac helper correct and use it in the intel glue ? Just an idea. [0]: https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/net/ethernet/stmicro/stmmac/stmmac_libpci.c#L28 Maxime > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > index fcd8008545c2..d624f61a35d9 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > @@ -1269,15 +1269,9 @@ static int intel_eth_pci_suspend(struct device *dev, void *bsp_priv) > static int intel_eth_pci_resume(struct device *dev, void *bsp_priv) > { > struct pci_dev *pdev = to_pci_dev(dev); > - int ret; > > pci_restore_state(pdev); > pci_set_power_state(pdev, PCI_D0); > - > - ret = pcim_enable_device(pdev); > - if (ret) > - return ret; > - > pci_set_master(pdev); > > return 0; > > --- > base-commit: c712df600d056cc35ef7621e43c8e12513bae886 > change-id: 20261201-s2p-d103-40aa9498b98d > > Best regards, > -- > Arina Kharlamova