net: phylink: fix suspend/resume with WoL enabled and link down
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 16 Apr 2025 16:16:01 +0000 (17:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 22 Apr 2025 23:56:44 +0000 (16:56 -0700)
commit4c8925cb9db158c812e1e11f3e74b945df7c9801
treeb9baf082fd96a706d7d67dd9f683357a1e88415d
parentc03a49f3093a4903c8a93c8b5c9a297b5343b169
net: phylink: fix suspend/resume with WoL enabled and link down

When WoL is enabled, we update the software state in phylink to
indicate that the link is down, and disable the resolver from
bringing the link back up.

On resume, we attempt to bring the overall state into consistency
by calling the .mac_link_down() method, but this is wrong if the
link was already down, as phylink strictly orders the .mac_link_up()
and .mac_link_down() methods - and this would break that ordering.

Fixes: f97493657c63 ("net: phylink: add suspend/resume support")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1u55Qf-0016RN-PA@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phylink.c