[PATCH net] net: macb: Disable clocks once

From: Sean Anderson
Date: Mon Aug 25 2025 - 13:00:00 EST


From: Neil Mandir <neil.mandir@xxxxxxxx>

When the driver is removed the clocks are twice: once by the driver and a
second time by runtime pm. Remove the redundant clock disabling. Disable
wakeup so all the clocks are disabled. 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@xxxxxxxx>
Co-developed-by: Sean Anderson <sean.anderson@xxxxxxxxx>
Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxxx>
---

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 ce95fad8cedd..8e9bfd0f040d 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5403,14 +5403,11 @@ static void macb_remove(struct platform_device *pdev)
mdiobus_free(bp->mii_bus);

unregister_netdev(dev);
+ 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