kernel: bump 5.15 to 5.15.62
[openwrt/staging/jow.git] / target / linux / bcm27xx / patches-5.15 / 950-0500-net-phy-lan87xx-Allow-more-time-for-link-detect.patch
1 From eb860f6a2dee9a4c94a7101c1d43194b95fdbc8d Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Wed, 22 Sep 2021 15:38:13 +0100
4 Subject: [PATCH] net: phy: lan87xx: Allow more time for link detect
5
6 With EDPWRDOWN set in idle, it must be cleared before checking for
7 ENERGYON going high, indicating that a link is being established.
8 The existing code allows 640ms for ENERGYON to go high, but on
9 Raspberry Pis that appears not to be enough, causing link detection
10 to fail.
11
12 Increase the polling timeout to 1500ms - with a polling interval of
13 10ms it shouldn't cause unnecessary delays.
14
15 See: https://github.com/raspberrypi/linux/issues/4393
16
17 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
18 ---
19 drivers/net/phy/smsc.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/net/phy/smsc.c
23 +++ b/drivers/net/phy/smsc.c
24 @@ -230,12 +230,12 @@ static int lan87xx_read_status(struct ph
25 if (rc < 0)
26 return rc;
27
28 - /* Wait max 640 ms to detect energy and the timeout is not
29 + /* Wait max 1500 ms to detect energy and the timeout is not
30 * an actual error.
31 */
32 read_poll_timeout(phy_read, rc,
33 rc & MII_LAN83C185_ENERGYON || rc < 0,
34 - 10000, 640000, true, phydev,
35 + 10000, 1500000, true, phydev,
36 MII_LAN83C185_CTRL_STATUS);
37 if (rc < 0)
38 return rc;