All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: Fix overlong PHY timeout
@ 2020-01-03 22:08 Andre Przywara
  2020-01-04  6:30 ` Stefan Roese
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andre Przywara @ 2020-01-03 22:08 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 80a7664e49..5cf9c165b6 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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;
-- 
2.14.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] net: phy: Fix overlong PHY timeout
  2020-01-03 22:08 [PATCH] net: phy: Fix overlong PHY timeout Andre Przywara
@ 2020-01-04  6:30 ` Stefan Roese
  2020-01-30 11:00 ` Matthias Brugger
  2020-03-05 23:20 ` Joe Hershberger
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2020-01-04  6:30 UTC (permalink / raw)
  To: u-boot

On 03.01.20 23:08, Andre Przywara wrote:
> 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.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>   drivers/net/phy/phy.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 80a7664e49..5cf9c165b6 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -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.

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] net: phy: Fix overlong PHY timeout
  2020-01-03 22:08 [PATCH] net: phy: Fix overlong PHY timeout Andre Przywara
  2020-01-04  6:30 ` Stefan Roese
@ 2020-01-30 11:00 ` Matthias Brugger
  2020-02-21 16:33   ` Matthias Brugger
  2020-03-05 23:20 ` Joe Hershberger
  2 siblings, 1 reply; 6+ messages in thread
From: Matthias Brugger @ 2020-01-30 11:00 UTC (permalink / raw)
  To: u-boot



On 03/01/2020 23:08, Andre Przywara wrote:
> 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.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

I tested this on RPi4 with the genet patches on top. Now the timeout is
reasonable :)

Tested-by: Matthias Brugger <mbrugger@suse.com>

> ---
>  drivers/net/phy/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 80a7664e49..5cf9c165b6 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -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;
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] net: phy: Fix overlong PHY timeout
  2020-01-30 11:00 ` Matthias Brugger
@ 2020-02-21 16:33   ` Matthias Brugger
  2020-03-05  7:25     ` Simon Goldschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Brugger @ 2020-02-21 16:33 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On 30/01/2020 12:00, Matthias Brugger wrote:
> 
> 
> On 03/01/2020 23:08, Andre Przywara wrote:
>> 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.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> 
> I tested this on RPi4 with the genet patches on top. Now the timeout is
> reasonable :)
> 
> Tested-by: Matthias Brugger <mbrugger@suse.com>
> 

Friedly reminder, are you planning to take this fix for v2020.04?

Regards,
Matthias

>> ---
>>  drivers/net/phy/phy.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>> index 80a7664e49..5cf9c165b6 100644
>> --- a/drivers/net/phy/phy.c
>> +++ b/drivers/net/phy/phy.c
>> @@ -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;
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] net: phy: Fix overlong PHY timeout
  2020-02-21 16:33   ` Matthias Brugger
@ 2020-03-05  7:25     ` Simon Goldschmidt
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Goldschmidt @ 2020-03-05  7:25 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 21, 2020 at 5:33 PM Matthias Brugger <matthias.bgg@gmail.com> wrote:
>
> Hi Joe,
>
> On 30/01/2020 12:00, Matthias Brugger wrote:
> >
> >
> > On 03/01/2020 23:08, Andre Przywara wrote:
> >> 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.
> >>
> >> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

A "Fixes:" tag would have been nice...

Anyway:
Tested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

> >
> > I tested this on RPi4 with the genet patches on top. Now the timeout is
> > reasonable :)
> >
> > Tested-by: Matthias Brugger <mbrugger@suse.com>
> >
>
> Friedly reminder, are you planning to take this fix for v2020.04?

Yes, please! This timeout is really annoying right now!

Regards,
Simon

>
> Regards,
> Matthias
>
> >> ---
> >>  drivers/net/phy/phy.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> >> index 80a7664e49..5cf9c165b6 100644
> >> --- a/drivers/net/phy/phy.c
> >> +++ b/drivers/net/phy/phy.c
> >> @@ -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;
> >>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] net: phy: Fix overlong PHY timeout
  2020-01-03 22:08 [PATCH] net: phy: Fix overlong PHY timeout Andre Przywara
  2020-01-04  6:30 ` Stefan Roese
  2020-01-30 11:00 ` Matthias Brugger
@ 2020-03-05 23:20 ` Joe Hershberger
  2 siblings, 0 replies; 6+ messages in thread
From: Joe Hershberger @ 2020-03-05 23:20 UTC (permalink / raw)
  To: u-boot

On Sat, Jan 4, 2020 at 3:56 AM Andre Przywara <andre.przywara@arm.com> wrote:
>
> 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.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-05 23:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03 22:08 [PATCH] net: phy: Fix overlong PHY timeout Andre Przywara
2020-01-04  6:30 ` Stefan Roese
2020-01-30 11:00 ` Matthias Brugger
2020-02-21 16:33   ` Matthias Brugger
2020-03-05  7:25     ` Simon Goldschmidt
2020-03-05 23:20 ` Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.