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
commit  094e36e10c122edc089f1629a3d906c21afa2319 from
https://github.com/raspberrypi/linux.git rpi-5.10.y

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/linux#4393

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Meng Li <Meng.Li@windriver.com>
  • Loading branch information
pelwell authored and limeng-linux committed Oct 9, 2021
1 parent 3c470a5 commit e42c211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/smsc.c
Expand Up @@ -195,12 +195,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 e42c211

Please sign in to comment.