Commit f24098f8 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: improve resuming from hibernation

I got an interesting report [0] that after resuming from hibernation
the link has 100Mbps instead of 1Gbps. Reason is that another OS has
been used whilst Linux was hibernated. And this OS speeds down the link
due to WoL. Therefore, when resuming, we shouldn't expect that what
the PHY advertises is what it did when hibernating.
Easiest way to do this is removing state PHY_RESUMING. Instead always
go via PHY_UP that configures PHY advertisement.

[0] https://bugzilla.kernel.org/show_bug.cgi?id=202851Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 22c0ef6b
...@@ -43,7 +43,6 @@ static const char *phy_state_to_str(enum phy_state st) ...@@ -43,7 +43,6 @@ static const char *phy_state_to_str(enum phy_state st)
PHY_STATE_STR(NOLINK) PHY_STATE_STR(NOLINK)
PHY_STATE_STR(FORCING) PHY_STATE_STR(FORCING)
PHY_STATE_STR(HALTED) PHY_STATE_STR(HALTED)
PHY_STATE_STR(RESUMING)
} }
return NULL; return NULL;
...@@ -859,10 +858,7 @@ void phy_start(struct phy_device *phydev) ...@@ -859,10 +858,7 @@ void phy_start(struct phy_device *phydev)
goto out; goto out;
} }
if (phydev->state == PHY_READY) phydev->state = PHY_UP;
phydev->state = PHY_UP;
else
phydev->state = PHY_RESUMING;
phy_start_machine(phydev); phy_start_machine(phydev);
out: out:
...@@ -897,7 +893,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -897,7 +893,6 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_NOLINK: case PHY_NOLINK:
case PHY_RUNNING: case PHY_RUNNING:
case PHY_RESUMING:
err = phy_check_link_status(phydev); err = phy_check_link_status(phydev);
break; break;
case PHY_FORCING: case PHY_FORCING:
......
...@@ -308,13 +308,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); ...@@ -308,13 +308,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
* *
* HALTED: PHY is up, but no polling or interrupts are done. Or * HALTED: PHY is up, but no polling or interrupts are done. Or
* PHY is in an error state. * PHY is in an error state.
* * - phy_start moves to UP
* - phy_start moves to RESUMING
*
* RESUMING: PHY was halted, but now wants to run again.
* - If we are forcing, or aneg is done, timer moves to RUNNING
* - If aneg is not done, timer moves to AN
* - phy_stop moves to HALTED
*/ */
enum phy_state { enum phy_state {
PHY_DOWN = 0, PHY_DOWN = 0,
...@@ -324,7 +318,6 @@ enum phy_state { ...@@ -324,7 +318,6 @@ enum phy_state {
PHY_RUNNING, PHY_RUNNING,
PHY_NOLINK, PHY_NOLINK,
PHY_FORCING, PHY_FORCING,
PHY_RESUMING
}; };
/** /**
......
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