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  59bd0184158581304069fe4e7347dbdf31d73f47 from
https://github.com/raspberrypi/linux.git rpi-5.15.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 29, 2021
1 parent 0db51f6 commit 3679101
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 3679101

Please sign in to comment.