net: stmmac: add to set device wake up flag when stmmac init phy
Subsystems (4)
PATCH v2 1/1 net: stmmac: add to set device wake up flag when stmmac init phy
From: Rongguang Wei <[email protected]>
When MAC is not support PMT, driver will check PHY's WoL capability and set device wakeup capability in stmmac_init_phy(). We can enable the WoL through ethtool, the driver would enable the device wake up flag. Now the device_may_wakeup() return true.
But if there is a way which enable the PHY's WoL capability derectly, like in BIOS. The driver would not know the enable thing and would not set the device wake up flag. The phy_suspend may failed like this:
[ 32.409063] PM: dpm_run_callback(): mdio_bus_phy_suspend+0x0/0x50 returns -16 [ 32.409065] PM: Device stmmac-1:00 failed to suspend: error -16 [ 32.409067] PM: Some devices failed to suspend, or early wake event detected
Add to set the device wakeup enable flag according to the get_wol function result in PHY can fix the error in this scene.
v2: add a Fixes tag.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
@@ -1170,6 +1170,7 @@ static int stmmac_init_phy(struct net_device *dev)phylink_ethtool_get_wol (priv->phylink, &wol);device_set_wakeup_capable (priv->device, !!wol.supported); +device_set_wakeup_enable (priv->device, !!wol.wolopts); }return ret;
Signature · 1 line
2.25.1
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Thu, 2 Mar 2023 14:21:43 +0800 you wrote:
From: Rongguang Wei <[email protected]>
When MAC is not support PMT, driver will check PHY's WoL capability and set device wakeup capability in
stmmac_init_phy(). We can enable the WoL through ethtool, the driver would enable the device wake up flag. Now thedevice_may_wakeup()return true.[...]
Here is the summary with links:
- [net,v2] net: stmmac: add to set device wake up flag when stmmac init phy
https://git.kernel.org/netdev/net/c/a9334b702a03
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html