Skip to content

Commit 6c8f85c

Browse files
noglitchdavem330
authored andcommitted
net: macb: fix call to pm_runtime in the suspend/resume functions
The calls to pm_runtime_force_suspend/resume() functions are only relevant if the device is not configured to act as a WoL wakeup source. Add the device_may_wakeup() test before calling them. Fixes: 3e2a5e1 ("net: macb: add wake-on-lan support via magic packet") Cc: Claudiu Beznea <[email protected]> Cc: Harini Katakam <[email protected]> Cc: Sergio Prado <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 64febc5 commit 6c8f85c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4606,7 +4606,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
46064606

46074607
if (bp->ptp_info)
46084608
bp->ptp_info->ptp_remove(netdev);
4609-
pm_runtime_force_suspend(dev);
4609+
if (!device_may_wakeup(dev))
4610+
pm_runtime_force_suspend(dev);
46104611

46114612
return 0;
46124613
}
@@ -4621,7 +4622,8 @@ static int __maybe_unused macb_resume(struct device *dev)
46214622
if (!netif_running(netdev))
46224623
return 0;
46234624

4624-
pm_runtime_force_resume(dev);
4625+
if (!device_may_wakeup(dev))
4626+
pm_runtime_force_resume(dev);
46254627

46264628
if (bp->wol & MACB_WOL_ENABLED) {
46274629
macb_writel(bp, IDR, MACB_BIT(WOL));

0 commit comments

Comments
 (0)