net: phy: Fix overlong PHY timeout
Subsystems (2)
PATCH 1/1 net: phy: Fix overlong PHY timeout
Commit 27c3f70f3b50 ("net: phy: Increase link up delay in genphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.
Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
--- 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.14.5
PATCH 1/1 net: phy: Fix overlong PHY timeout
Quoted 19 lines · Andre Przywara
Commit
27c3f70f3b50("net: phy: Increase link up delay ingenphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
Signed-off-by Andre Przywara <[email protected]>--- 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 ;
Andre, thanks for taking care of this.
Thanks,
Stefan
PATCH 1/1 net: phy: Fix overlong PHY timeout
In reply to Andre PrzywaraQuoted 9 lines · Andre Przywara
Commit
27c3f70f3b50("net: phy: Increase link up delay ingenphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
Signed-off-by Andre Przywara <[email protected]>
I tested this on RPi4 with the genet patches on top. Now the timeout is reasonable :)
Quoted 18 lines
--- 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 ;
PATCH 1/1 net: phy: Fix overlong PHY timeout
Hi Joe,
Quoted 11 lines · Matthias Brugger
Quoted 8 lines · Andre Przywara
Commit
27c3f70f3b50("net: phy: Increase link up delay ingenphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
Quoted 7 lines
Quoted 1 line
Signed-off-by Andre Przywara <[email protected]>I tested this on RPi4 with the genet patches on top. Now the timeout is reasonable :)
Tested-by Matthias Brugger <[email protected]>
Friedly reminder, are you planning to take this fix for v2020.04?
Regards,
Matthias
Quoted 18 lines
Quoted 18 lines
--- 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 ;
PATCH 1/1 net: phy: Fix overlong PHY timeout
Quoted 16 lines · Matthias Brugger
Hi Joe,
Quoted 12 lines · Matthias Brugger
Quoted 9 lines · Andre Przywara
Commit
27c3f70f3b50("net: phy: Increase link up delay ingenphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
Signed-off-by Andre Przywara <[email protected]>
A "Fixes:" tag would have been nice...
Anyway:
Quoted 8 lines
Quoted 6 lines
I tested this on RPi4 with the genet patches on top. Now the timeout is reasonable :)
Tested-by Matthias Brugger <[email protected]>Friedly reminder, are you planning to take this fix for v2020.04?
Yes, please! This timeout is really annoying right now!
Regards,
Simon
Quoted 23 lines
Regards,
MatthiasQuoted 18 lines
Quoted 18 lines
--- 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 ;
PATCH 1/1 net: phy: Fix overlong PHY timeout
In reply to Andre PrzywaraQuoted 10 lines · Andre Przywara
Commit
27c3f70f3b50("net: phy: Increase link up delay ingenphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes.Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value.
Signed-off-by Andre Przywara <[email protected]>