Skip to contentSkip to conversation

net: phy: Increase link up delay in genphy_update_link()

PATCH New Stefan Roese 2 participants 2 messages Sep 30, 2019 – Nov 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: Increase link up delay in genphy_update_link()

I've noticed that in most cases when genphy_update_link() is called, the ethernet driver (mt7628-eth in this case) fails with the first ethernet packets. Resulting in a timeout of the first tftp command. Increasing the delay in the link check look from 1 to 50 ms and moving it below the BMSR register read fixes this issue, resulting in a stable ethernet traffic, even after initial link autonogotiation.

Cc Weijie Gao <[email protected]>
Cc Joe Hershberger <[email protected]>
---
 drivers/net/phy/phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +2 -2
index ae37dd6c1e..18e5ebd29c 100644
@@ -256,11 +256,11 @@ int genphy_update_link(struct phy_device *phydev)
 				return -EINTR;
 			}
 
-			if ((i++ % 500) == 0)
+			if ((i++ % 10) == 0)
 				printf(".");
 
-			udelay(1000);	/* 1 ms */
 			mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
+			mdelay(50);	/* 50 ms */
 		}
 		printf(" done\n");
 		phydev->link = 1;
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 net: phy: Increase link up delay in genphy_update_link()

Quoted 11 lines · Stefan Roese

I've noticed that in most cases when genphy_update_link() is called, the ethernet driver (mt7628-eth in this case) fails with the first ethernet packets. Resulting in a timeout of the first tftp command. Increasing the delay in the link check look from 1 to 50 ms and moving it below the BMSR register read fixes this issue, resulting in a stable ethernet traffic, even after initial link autonogotiation.

Cc Weijie Gao <[email protected]>
Cc Joe Hershberger <[email protected]>