LF-3689-1 net: stmmac: fix MAC WoL unwork if PHY doesn't support WoL
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Wed, 7 Apr 2021 07:04:07 +0000 (15:04 +0800)
committerJoakim Zhang <qiangqing.zhang@nxp.com>
Tue, 13 Apr 2021 01:48:32 +0000 (09:48 +0800)
commit6974f63ea5a23e3944ec1f212d2172ddfdbd641d
treea42f265501f3309d30cfc9aace21d508852361b4
parent63474094f3941591139deee9b3f7cb741a575a72
LF-3689-1 net: stmmac: fix MAC WoL unwork if PHY doesn't support WoL

Both get and set WoL will check device_can_wakeup(), if MAC supports
PMT, it will set device wakeup capability. After commit 1d8e5b0f3f2c ("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.

Fixes: commit 1d8e5b0f3f2c ("net: stmmac: Support WOL with phy")
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c