Skip to content

Commit f24098f

Browse files
hkallweitdavem330
authored andcommitted
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=202851 Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 22c0ef6 commit f24098f

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

‎drivers/net/phy/phy.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ static const char *phy_state_to_str(enum phy_state st)
4343
PHY_STATE_STR(NOLINK)
4444
PHY_STATE_STR(FORCING)
4545
PHY_STATE_STR(HALTED)
46-
PHY_STATE_STR(RESUMING)
4746
}
4847

4948
return NULL;
@@ -859,10 +858,7 @@ void phy_start(struct phy_device *phydev)
859858
goto out;
860859
}
861860

862-
if (phydev->state == PHY_READY)
863-
phydev->state = PHY_UP;
864-
else
865-
phydev->state = PHY_RESUMING;
861+
phydev->state = PHY_UP;
866862

867863
phy_start_machine(phydev);
868864
out:
@@ -897,7 +893,6 @@ void phy_state_machine(struct work_struct *work)
897893
break;
898894
case PHY_NOLINK:
899895
case PHY_RUNNING:
900-
case PHY_RESUMING:
901896
err = phy_check_link_status(phydev);
902897
break;
903898
case PHY_FORCING:

‎include/linux/phy.h‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
308308
*
309309
* HALTED: PHY is up, but no polling or interrupts are done. Or
310310
* PHY is in an error state.
311-
*
312-
* - phy_start moves to RESUMING
313-
*
314-
* RESUMING: PHY was halted, but now wants to run again.
315-
* - If we are forcing, or aneg is done, timer moves to RUNNING
316-
* - If aneg is not done, timer moves to AN
317-
* - phy_stop moves to HALTED
311+
* - phy_start moves to UP
318312
*/
319313
enum phy_state {
320314
PHY_DOWN = 0,
@@ -324,7 +318,6 @@ enum phy_state {
324318
PHY_RUNNING,
325319
PHY_NOLINK,
326320
PHY_FORCING,
327-
PHY_RESUMING
328321
};
329322

330323
/**

0 commit comments

Comments
 (0)