Skip to content

Commit

Permalink
net: phy: lan87xx: Allow more time for link detect
Browse files Browse the repository at this point in the history
With EDPWRDOWN set in idle, it must be cleared before checking for
ENERGYON going high, indicating that a link is being established.
The existing code allows 640ms for ENERGYON to go high, but on
Raspberry Pis that appears not to be enough, causing link detection
to fail.

Increase the polling timeout to 1500ms - with a polling interval of
10ms it shouldn't cause unnecessary delays.

See: raspberrypi#4393

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
  • Loading branch information
pelwell authored and herrnst committed May 25, 2022
1 parent b961a70 commit 84865e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/smsc.c
Expand Up @@ -228,12 +228,12 @@ static int lan87xx_read_status(struct phy_device *phydev)
if (rc < 0)
return rc;

/* Wait max 640 ms to detect energy and the timeout is not
/* Wait max 1500 ms to detect energy and the timeout is not
* an actual error.
*/
read_poll_timeout(phy_read, rc,
rc & MII_LAN83C185_ENERGYON || rc < 0,
10000, 640000, true, phydev,
10000, 1500000, true, phydev,
MII_LAN83C185_CTRL_STATUS);
if (rc < 0)
return rc;
Expand Down

0 comments on commit 84865e3

Please sign in to comment.