Commit 32535611 authored by Nathan Sullivan's avatar Nathan Sullivan Committed by Jiri Slaby

net: phy: handle state correctly in phy_stop_machine

[ Upstream commit 49d52e81 ]

If the PHY is halted on stop, then do not set the state to PHY_UP.  This
ensures the phy will be restarted later in phy_start when the machine is
started again.

Fixes: 00db8189 ("This patch adds a PHY Abstraction Layer to the Linux Kernel, enabling ethernet drivers to remain as ignorant as is reasonable of the connected PHY's design and operation details.")
Signed-off-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
Signed-off-by: default avatarBrad Mouring <brad.mouring@ni.com>
Acked-by: default avatarXander Huff <xander.huff@ni.com>
Acked-by: default avatarKyle Roeschley <kyle.roeschley@ni.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1337a4ff
......@@ -473,7 +473,7 @@ void phy_stop_machine(struct phy_device *phydev)
cancel_delayed_work_sync(&phydev->state_queue);
mutex_lock(&phydev->lock);
if (phydev->state > PHY_UP)
if (phydev->state > PHY_UP && phydev->state != PHY_HALTED)
phydev->state = PHY_UP;
mutex_unlock(&phydev->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment