Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume
@ 2026-12-01 19:14 Arina Kharlamova via B4 Relay
  2026-12-01 19:20 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:14 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Bjorn Helgaas, Krzysztof Wilczyński, Philipp Stanner
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-pci,
	Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

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 <arina.kharlamova@mbzuai.ac.ae>
---
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;

---
base-commit: c712df600d056cc35ef7621e43c8e12513bae886
change-id: 20261201-s2p-d103-40aa9498b98d

Best regards,
--  
Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume
  2026-12-01 19:14 [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume Arina Kharlamova via B4 Relay
@ 2026-12-01 19:20 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-01 19:20 UTC (permalink / raw)
  To: Arina Kharlamova; +Cc: linux-pci

> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
> 
> 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 <arina.kharlamova@mbzuai.ac.ae>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-01 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 19:14 [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume Arina Kharlamova via B4 Relay
2026-12-01 19:20 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox