net: phy: fix autoneg timeout
Subsystems (2)
PATCH 1/1 net: phy: fix autoneg timeout
Recently, genphy_update_link() has been changed to use a 50ms polling interval instead of the previous 1ms. However, the timeout to give up waiting for a link remained unchanged, calculating the iterations.
As a result, PHY_ANEG_TIMEOUT now specifies "multiples of 50ms" instead of just to be a number of milliseconds.
Fix this by dividing PHY_ANEG_TIMEOUT by 50 in this loop. This gets us back to a 4 seconds timeout for the default value (instead of 200s).
---
This should be applied before the next release as it fixes a regression of v2020.01!
drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy.c +1 -1
@@ -244,7 +244,7 @@ int genphy_update_link(struct phy_device *phydev)/* * Timeout reached ? */ -if (i >PHY_ANEG_TIMEOUT ) { +if (i > (PHY_ANEG_TIMEOUT /50 )) {printf (" TIMEOUT !\n" ); phydev->link =0 ;return -ETIMEDOUT ;
Signature · 1 line
2.20.1
PATCH 1/1 net: phy: fix autoneg timeout
Hi Simon,
Quoted 26 lines · Simon Goldschmidt
Recently,
genphy_update_link()has been changed to use a 50ms polling interval instead of the previous 1ms. However, the timeout to give up waiting for a link remained unchanged, calculating the iterations.As a result,
PHY_ANEG_TIMEOUTnow specifies "multiples of 50ms" instead of just to be a number of milliseconds.Fix this by dividing
PHY_ANEG_TIMEOUTby 50 in this loop. This gets us back to a 4 seconds timeout for the default value (instead of 200s).Fixes net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")Signed-off-by Simon Goldschmidt <[email protected]>---
This should be applied before the next release as it fixes a regression of v2020.01!
drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/phy.c +0
-0
drivers/net/phy/phy.c int genphy_update_link(struct phy_device *phydev) · line 250
Quoted 8 lines
drivers/net/phy/phy.c +1
-1@@ -244,7 +244,7 @@ int genphy_update_link(struct phy_device *phydev)/* * Timeout reached ? */ -if (i >PHY_ANEG_TIMEOUT ) { +if (i > (PHY_ANEG_TIMEOUT /50 )) {printf (" TIMEOUT !\n" ); phydev->link =0 ;return -ETIMEDOUT ;
A similar fix from Andre for this is queued for this for quite some time now:
https://patchwork.ozlabs.org/patch/1217524/
Joe or Tom, could you please take this one?
Thanks,
Stefan
PATCH 1/1 net: phy: fix autoneg timeout
Quoted 42 lines · Stefan Roese
Hi Simon,
Quoted 26 lines · Simon Goldschmidt
Recently,
genphy_update_link()has been changed to use a 50ms polling interval instead of the previous 1ms. However, the timeout to give up waiting for a link remained unchanged, calculating the iterations.As a result,
PHY_ANEG_TIMEOUTnow specifies "multiples of 50ms" instead of just to be a number of milliseconds.Fix this by dividing
PHY_ANEG_TIMEOUTby 50 in this loop. This gets us back to a 4 seconds timeout for the default value (instead of 200s).Fixes net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")Signed-off-by Simon Goldschmidt <[email protected]>---
This should be applied before the next release as it fixes a regression of v2020.01!
drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/phy.c +0
-0drivers/net/phy/phy.c int genphy_update_link(struct phy_device *phydev) · line 250
Quoted 8 lines
drivers/net/phy/phy.c +1
-1@@ -244,7 +244,7 @@ int genphy_update_link(struct phy_device *phydev)/* * Timeout reached ? */ -if (i >PHY_ANEG_TIMEOUT ) { +if (i > (PHY_ANEG_TIMEOUT /50 )) {printf (" TIMEOUT !\n" ); phydev->link =0 ;return -ETIMEDOUT ;A similar fix from Andre for this is queued for this for quite some time now:
Quoted 1 line
Right. I thought I remembered a patch but hadn't found it...
I'll drop this one then.
Regards,
Simon
Quoted 5 lines
Joe or Tom, could you please take this one?
Thanks,
Stefan