Commit 6c8f85ca authored by Nicolas Ferre's avatar Nicolas Ferre Committed by David S. Miller

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: 3e2a5e15 ("net: macb: add wake-on-lan support via magic packet")
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Harini Katakam <harini.katakam@xilinx.com>
Cc: Sergio Prado <sergio.prado@e-labworks.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64febc5e
...@@ -4606,7 +4606,8 @@ static int __maybe_unused macb_suspend(struct device *dev) ...@@ -4606,7 +4606,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
if (bp->ptp_info) if (bp->ptp_info)
bp->ptp_info->ptp_remove(netdev); bp->ptp_info->ptp_remove(netdev);
pm_runtime_force_suspend(dev); if (!device_may_wakeup(dev))
pm_runtime_force_suspend(dev);
return 0; return 0;
} }
...@@ -4621,7 +4622,8 @@ static int __maybe_unused macb_resume(struct device *dev) ...@@ -4621,7 +4622,8 @@ static int __maybe_unused macb_resume(struct device *dev)
if (!netif_running(netdev)) if (!netif_running(netdev))
return 0; return 0;
pm_runtime_force_resume(dev); if (!device_may_wakeup(dev))
pm_runtime_force_resume(dev);
if (bp->wol & MACB_WOL_ENABLED) { if (bp->wol & MACB_WOL_ENABLED) {
macb_writel(bp, IDR, MACB_BIT(WOL)); macb_writel(bp, IDR, MACB_BIT(WOL));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment