Commit 9ff9c6a9 authored by Florian Fainelli's avatar Florian Fainelli Committed by sanglipeng
Browse files

net: phy: Ensure state transitions are processed from phy_stop()

stable inclusion
from stable-v5.10.177
commit 1b333766ea7a65ee779dd7b91ad3325d1526db7e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1b333766ea7a65ee779dd7b91ad3325d1526db7e



--------------------------------

[ Upstream commit 4203d840 ]

In the phy_disconnect() -> phy_stop() path, we will be forcibly setting
the PHY state machine to PHY_HALTED. This invalidates the old_state !=
phydev->state condition in phy_state_machine() such that we will neither
display the state change for debugging, nor will we invoke the
link_change_notify() callback.

Factor the code by introducing phy_process_state_change(), and ensure
that we process the state change from phy_stop() as well.

Fixes: 5c5f626b ("net: phy: improve handling link_change_notify callback")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 4f5ce686
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment