linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] net: macb: Disable clocks once
@ 2025-08-26 14:30 Sean Anderson
  2025-08-28  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Anderson @ 2025-08-26 14:30 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev
  Cc: Nicolas Ferre, Claudiu Beznea, Shubhrajyoti Datta, Neil Mandir,
	linux-kernel, Harini Katakam, Sean Anderson

From: Neil Mandir <neil.mandir@seco.com>

When the driver is removed the clocks are disabled twice: once in
macb_remove and a second time by runtime pm. Disable wakeup in remove so
all the clocks are disabled and skip the second call to macb_clks_disable.
Always suspend the device as we always set it active in probe.

Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support")
Signed-off-by: Neil Mandir <neil.mandir@seco.com>
Co-developed-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---

Changes in v2:
- Spruce up the commit message
- Rebase

 drivers/net/ethernet/cadence/macb_main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index b29c3beae0b2..ca9f671d971f 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5404,14 +5404,11 @@ static void macb_remove(struct platform_device *pdev)
 		mdiobus_unregister(bp->mii_bus);
 		mdiobus_free(bp->mii_bus);
 
+		device_set_wakeup_enable(&bp->pdev->dev, 0);
 		cancel_work_sync(&bp->hresp_err_bh_work);
 		pm_runtime_disable(&pdev->dev);
 		pm_runtime_dont_use_autosuspend(&pdev->dev);
-		if (!pm_runtime_suspended(&pdev->dev)) {
-			macb_clks_disable(bp->pclk, bp->hclk, bp->tx_clk,
-					  bp->rx_clk, bp->tsu_clk);
-			pm_runtime_set_suspended(&pdev->dev);
-		}
+		pm_runtime_set_suspended(&pdev->dev);
 		phylink_destroy(bp->phylink);
 		free_netdev(dev);
 	}
-- 
2.35.1.1320.gc452695387.dirty


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

* Re: [PATCH net v2] net: macb: Disable clocks once
  2025-08-26 14:30 [PATCH net v2] net: macb: Disable clocks once Sean Anderson
@ 2025-08-28  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-28  8:40 UTC (permalink / raw)
  To: Sean Anderson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	nicolas.ferre, claudiu.beznea, shubhrajyoti.datta, neil.mandir,
	linux-kernel, harini.katakam

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue, 26 Aug 2025 10:30:22 -0400 you wrote:
> From: Neil Mandir <neil.mandir@seco.com>
> 
> When the driver is removed the clocks are disabled twice: once in
> macb_remove and a second time by runtime pm. Disable wakeup in remove so
> all the clocks are disabled and skip the second call to macb_clks_disable.
> Always suspend the device as we always set it active in probe.
> 
> [...]

Here is the summary with links:
  - [net,v2] net: macb: Disable clocks once
    https://git.kernel.org/netdev/net/c/dac978e51cce

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-08-28  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 14:30 [PATCH net v2] net: macb: Disable clocks once Sean Anderson
2025-08-28  8:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).