Commit 8742beb5 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by David S. Miller

net: phy: Fix the issue that netif always links up after resuming

Even though the link is down before entering hibernation,
there is an issue that the network interface always links up after resuming
from hibernation.

If the link is still down before enabling the network interface,
and after resuming from hibernation, the phydev->state is forcibly set
to PHY_UP in mdio_bus_phy_restore(), and the link becomes up.

In suspend sequence, only if the PHY is attached, mdio_bus_phy_suspend()
calls phy_stop_machine(), and mdio_bus_phy_resume() calls
phy_start_machine().
In resume sequence, it's enough to do the same as mdio_bus_phy_resume()
because the state has been preserved.

This patch fixes the issue by calling phy_start_machine() in
mdio_bus_phy_restore() in the same way as mdio_bus_phy_resume().

Fixes: bc87922f ("phy: Move PHY PM operations into phy_device")
Suggested-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 15515aaa
...@@ -308,10 +308,7 @@ static int mdio_bus_phy_restore(struct device *dev) ...@@ -308,10 +308,7 @@ static int mdio_bus_phy_restore(struct device *dev)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* The PHY needs to renegotiate. */ if (phydev->attached_dev && phydev->adjust_link)
phydev->link = 0;
phydev->state = PHY_UP;
phy_start_machine(phydev); phy_start_machine(phydev);
return 0; return 0;
......
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