mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
net: macb: fix call to pm_runtime in the suspend/resume functions
[ Upstream commit 6c8f85cac98a4c6b767c4c4f6af7283724c32b47 ]
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: 3e2a5e1539 ("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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ad396c483d
commit
f62f896a56
1 changed files with 4 additions and 2 deletions
|
|
@ -4453,7 +4453,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
|
|||
netif_carrier_off(netdev);
|
||||
if (bp->ptp_info)
|
||||
bp->ptp_info->ptp_remove(netdev);
|
||||
pm_runtime_force_suspend(dev);
|
||||
if (!device_may_wakeup(dev))
|
||||
pm_runtime_force_suspend(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -4468,7 +4469,8 @@ static int __maybe_unused macb_resume(struct device *dev)
|
|||
if (!netif_running(netdev))
|
||||
return 0;
|
||||
|
||||
pm_runtime_force_resume(dev);
|
||||
if (!device_may_wakeup(dev))
|
||||
pm_runtime_force_resume(dev);
|
||||
|
||||
if (bp->wol & MACB_WOL_ENABLED) {
|
||||
macb_writel(bp, IDR, MACB_BIT(WOL));
|
||||
|
|
|
|||
Loading…
Reference in a new issue