* [PATCH net] net: macb: Disable clocks once
@ 2025-08-25 16:59 Sean Anderson
2025-08-25 17:08 ` Florian Fainelli
2025-08-26 0:45 ` Jakub Kicinski
0 siblings, 2 replies; 3+ messages in thread
From: Sean Anderson @ 2025-08-25 16:59 UTC (permalink / raw)
To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev
Cc: linux-kernel, Harini Katakam, Neil Mandir, Claudiu Beznea,
Shubhrajyoti Datta, Nicolas Ferre, Sean Anderson
From: Neil Mandir <neil.mandir@seco.com>
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@seco.com>
Co-developed-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: macb: Disable clocks once
2025-08-25 16:59 [PATCH net] net: macb: Disable clocks once Sean Anderson
@ 2025-08-25 17:08 ` Florian Fainelli
2025-08-26 0:45 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2025-08-25 17:08 UTC (permalink / raw)
To: Sean Anderson, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev
Cc: linux-kernel, Harini Katakam, Neil Mandir, Claudiu Beznea,
Shubhrajyoti Datta, Nicolas Ferre
On 8/25/25 09:59, Sean Anderson wrote:
> From: Neil Mandir <neil.mandir@seco.com>
>
> 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.
There is a missing word in that first sentence which I assume is "disabled".
>
> 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>
> ---
>
> 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);
> }
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: macb: Disable clocks once
2025-08-25 16:59 [PATCH net] net: macb: Disable clocks once Sean Anderson
2025-08-25 17:08 ` Florian Fainelli
@ 2025-08-26 0:45 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-08-26 0:45 UTC (permalink / raw)
To: Sean Anderson
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni, netdev,
linux-kernel, Harini Katakam, Neil Mandir, Claudiu Beznea,
Shubhrajyoti Datta, Nicolas Ferre
On Mon, 25 Aug 2025 12:59:25 -0400 Sean Anderson wrote:
> From: Neil Mandir <neil.mandir@seco.com>
>
> 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.
needs a rebase:
$ git pw series apply 995325
Failed to apply patch:
Applying: net: macb: Disable clocks once
Using index info to reconstruct a base tree...
M drivers/net/ethernet/cadence/macb_main.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/ethernet/cadence/macb_main.c
CONFLICT (content): Merge conflict in drivers/net/ethernet/cadence/macb_main.c
Recorded preimage for 'drivers/net/ethernet/cadence/macb_main.c'
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 net: macb: Disable clocks once
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-26 0:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 16:59 [PATCH net] net: macb: Disable clocks once Sean Anderson
2025-08-25 17:08 ` Florian Fainelli
2025-08-26 0:45 ` Jakub Kicinski
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).