From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796314039; b=JOEc6xMuU3PB6wVu04uJMBQRq5N1bj639FM7Ru4cB4v+v/0wCfQNgFacghwAZepQk5no 5fJQdR8iPwfzbDx99B/WS8+syiGjC1cpm2mwShYuDsMjEX0vsTy0d1y6Kw1Jb6Y3KXWs2 IcL04xkKzao5rqAp+VGUG/qif0Whg+/KS3U4k2LN6MtVvg/Gz0kGZ16ludHtHPocZQEne Y4mgx+uI448JCRlezLF2A/qeJTno0YAHlbiuguNE4SNxD58cpCVNYo5EtSTdVTUqt7GZ+ FMMlVYMdWWrcsZ2ODZdoyYKwlJJnSAqKRBkHKEWT+E1ohVTzH5vA/WCpkYu4H2ZgWRw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314039; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; b=4PMUU7FwW6brnVE6dM+DyAtXzIWvouZLANhUBq9uIf6a8TY7H9gKMtEcQmijWgVhNZDM aWDRu6wlN0HIsRGrNdJDsnzI61JfJh6whEGEpdP9oE/OKqj1gWHJsL3kY284rNWZjgjC2 Xo5CaGjJH7krjnOFJ4fom61bnisRvtptn+mP95GKY+UrtXs1uFUG4tyw3IqYku1rS25EQ YV1uJ3d5fQ+ZThiWlse09wa1WUq54OWti0hZmlscMJnvtnZQAy63XYlpQnPhjRJdbYcOH zTkvB+uFH3lN3yTak6LBOHplg2UEzM43ifzDw70YtN2kNTxuieZ27qrG0Lw2m6DiY6g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44509606A322; Thu, 3 Dec 2026 16:07:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 991081F00893; Thu, 3 Dec 2026 16:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796314038; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; h=Date:From:To:Cc:Subject:In-Reply-To; b=HKgOPmPU7tDtbXyMgvUE441up1HQqaZB88LR8vJ6Dhgcj1194nclFeEYBB93AGqBj 4HIC6QNl1lczrAS6x+Xz6KaYtqZF5dCeVksszfcqGQk49M9b8YKzwvRCfUav2vE1uv N8enD4mEafnwwrv26weTNlNlBdpeKUR1RNlRUP3FEts3yoLonl8JbQH5xXb3ZohkA1 HLou7CgJ8S9x0x4HpJBmXnnbqLKAzziWlp9z8yU1MbuBOclPOe7Iq+iYZKiLC295DC 83sd+QVy0xnAveOqWh29UKiNVEHn032dxQyCWzN813PNf2PCtoP3XOm0CKeL+8PF3F 0veVdkX+MN74g== Date: Thu, 3 Dec 2026 10:07:17 -0600 From: Bjorn Helgaas To: arina.kharlamova@mbzuai.ac.ae Cc: Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Philipp Stanner , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Vaibhav Gupta Subject: Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume Message-ID: <20261203160717.GA811382@bhelgaas> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae> [+cc Vaibhav] On Tue, Dec 01, 2026 at 11:14:13PM +0400, 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. > --- > 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; This looks like another candidate for simplification. intel_eth_pci_driver already uses generic power management via stmmac_simple_pm_ops, but that ends up in intel_eth_pci_suspend() and intel_eth_pci_resume(). Both of those look like they're probably redundant and could be completely removed because the PCI core power management should take care of what they do. Bjorn