Skip to content

Commit 2cc991d

Browse files
Neil Mandirdongert
authored andcommitted
net: macb: Disable clocks once
[ Upstream commit dac978e ] 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: d54f89a ("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> Link: https://patch.msgid.link/20250826143022.935521-1-sean.anderson@linux.dev Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 7b6b76e3f0790862405dc33343995a99defdad30)
1 parent 415a230 commit 2cc991d

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5231,14 +5231,11 @@ static void macb_remove(struct platform_device *pdev)
52315231
mdiobus_unregister(bp->mii_bus);
52325232
mdiobus_free(bp->mii_bus);
52335233

5234+
device_set_wakeup_enable(&bp->pdev->dev, 0);
52345235
cancel_work_sync(&bp->hresp_err_bh_work);
52355236
pm_runtime_disable(&pdev->dev);
52365237
pm_runtime_dont_use_autosuspend(&pdev->dev);
5237-
if (!pm_runtime_suspended(&pdev->dev)) {
5238-
macb_clks_disable(bp->pclk, bp->hclk, bp->tx_clk,
5239-
bp->rx_clk, bp->tsu_clk);
5240-
pm_runtime_set_suspended(&pdev->dev);
5241-
}
5238+
pm_runtime_set_suspended(&pdev->dev);
52425239
phylink_destroy(bp->phylink);
52435240
free_netdev(dev);
52445241
}

0 commit comments

Comments
 (0)