1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/bcm27xx/patches-5.15/950-0512-net-phy-lan87xx-Allow-more-time-for-link-detect.patch

39 lines
1.3 KiB
Diff
Raw Normal View History

2022-04-22 15:00:47 +00:00
From bcaed04f0a8b543590f476498b9abb7e4680e844 Mon Sep 17 00:00:00 2001
2021-11-24 17:32:01 +00:00
From: Phil Elwell <phil@raspberrypi.com>
Date: Wed, 22 Sep 2021 15:38:13 +0100
2022-04-22 15:00:47 +00:00
Subject: [PATCH 512/828] net: phy: lan87xx: Allow more time for link detect
2021-11-24 17:32:01 +00:00
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: https://github.com/raspberrypi/linux/issues/4393
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/net/phy/smsc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
2022-04-22 15:00:47 +00:00
@@ -228,12 +228,12 @@ static int lan87xx_read_status(struct ph
2021-11-24 17:32:01 +00:00
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;