]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: Fix MAC WoL not working if PHY does not support WoL
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Mon, 10 May 2021 06:55:09 +0000 (14:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 May 2021 22:55:51 +0000 (15:55 -0700)
commit4ab97361c95bf10ae087739548dba3ae6dc25167
tree2397427d843190de3787fc59c501b60a940fffef
parent31ddbf30ae7e8a88bc5fd02072664c9ee67769a0
net: stmmac: Fix MAC WoL not working if PHY does not support WoL

Both get and set WoL will check device_can_wakeup(), if MAC supports PMT, it
will set device wakeup capability. After commit 90dfa4dab77c ("net: stmmac:
Support WOL with phy"), device wakeup capability will be overwrite in
stmmac_init_phy() according to phy's Wol feature. If phy doesn't support WoL,
then MAC will lose wakeup capability. To fix this issue, only overwrite device
wakeup capability when MAC doesn't support PMT.

For STMMAC now driver checks MAC's WoL capability if MAC supports PMT, if
not support, driver will check PHY's WoL capability.

Fixes: 90dfa4dab77c ("net: stmmac: Support WOL with phy")
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c