]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: phy: Ensure state transitions are processed from phy_stop()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 16 Mar 2023 20:33:24 +0000 (13:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:49:04 +0000 (12:49 +0200)
commit8f07f16b3455c58f944c4bf43dcf965ba8f90d54
treeb11c319033c7a01ede039bb8487fb98816aaf372
parent9d882229d365f68f74028252261ab14a8de7faed
net: phy: Ensure state transitions are processed from phy_stop()

[ Upstream commit 4203d84032e28f893594a453bd8bc9c3b15c7334 ]

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: 5c5f626bcace ("net: phy: improve handling link_change_notify callback")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy.c