* [PATCH] net: phy: fix autoneg timeout
@ 2020-03-04 20:12 Simon Goldschmidt
2020-03-05 4:40 ` Stefan Roese
0 siblings, 1 reply; 3+ messages in thread
From: Simon Goldschmidt @ 2020-03-04 20:12 UTC (permalink / raw)
To: u-boot
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).
Fixes: net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
---
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(-)
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.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] net: phy: fix autoneg timeout
2020-03-04 20:12 [PATCH] net: phy: fix autoneg timeout Simon Goldschmidt
@ 2020-03-05 4:40 ` Stefan Roese
2020-03-05 7:19 ` Simon Goldschmidt
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2020-03-05 4:40 UTC (permalink / raw)
To: u-boot
Hi Simon,
On 04.03.20 21:12, Simon Goldschmidt wrote:
> 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).
>
> Fixes: net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> ---
>
> 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(-)
>
> 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;
>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] net: phy: fix autoneg timeout
2020-03-05 4:40 ` Stefan Roese
@ 2020-03-05 7:19 ` Simon Goldschmidt
0 siblings, 0 replies; 3+ messages in thread
From: Simon Goldschmidt @ 2020-03-05 7:19 UTC (permalink / raw)
To: u-boot
On Thu, Mar 5, 2020 at 5:40 AM Stefan Roese <sr@denx.de> wrote:
>
> Hi Simon,
>
> On 04.03.20 21:12, Simon Goldschmidt wrote:
> > 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).
> >
> > Fixes: net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")
> > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> > ---
> >
> > 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(-)
> >
> > 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;
> >
>
> A similar fix from Andre for this is queued for this for quite some
> time now:
>
> https://patchwork.ozlabs.org/patch/1217524/
Right. I thought I remembered a patch but hadn't found it...
I'll drop this one then.
Regards,
Simon
>
> Joe or Tom, could you please take this one?
>
> Thanks,
> Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-05 7:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 20:12 [PATCH] net: phy: fix autoneg timeout Simon Goldschmidt
2020-03-05 4:40 ` Stefan Roese
2020-03-05 7:19 ` Simon Goldschmidt
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.