lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210407104404.5781-1-qiangqing.zhang@nxp.com>
Date:   Wed,  7 Apr 2021 18:44:04 +0800
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     peppe.cavallaro@...com, alexandre.torgue@...com,
        joabreu@...opsys.com, davem@...emloft.net, kuba@...nel.org,
        f.fainelli@...il.com, andrew@...n.ch
Cc:     netdev@...r.kernel.org, linux-imx@....com,
        Jisheng.Zhang@...aptics.com
Subject: [PATCH net] 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")
Signed-off-by: Joakim Zhang <qiangqing.zhang@....com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 208cae344ffa..f46d9c69168f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1103,7 +1103,9 @@ static int stmmac_init_phy(struct net_device *dev)
 	}
 
 	phylink_ethtool_get_wol(priv->phylink, &wol);
-	device_set_wakeup_capable(priv->device, !!wol.supported);
+
+	if (!priv->plat->pmt)
+		device_set_wakeup_capable(priv->device, !!wol.supported);
 
 	return ret;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ