mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH] net: phy: fix waiting for link
Date: Fri, 12 Mar 2021 11:23:56 +0100	[thread overview]
Message-ID: <fdfda15d-cdcd-19a7-a874-98c0b2b3c89c@pengutronix.de> (raw)
In-Reply-To: <20210312101309.29650-1-s.hauer@pengutronix.de>



On 12.03.21 11:13, Sascha Hauer wrote:
> phydev->adjust_link() is called only from phy_update_status() when the
> link status changes during that function. phydev->link is also updated
> in genphy_update_link() called from phy_wait_aneg_done(), so it can
> happen that phydev->link changes outside of phy_update_status(), thus
> phydev->adjust_link is never called and no link change notice is
> printed.
> 
> Instead of calling genphy_update_link() from phy_wait_aneg_done(), call
> phy_update_status(). This makes sure that a link change is properly
> noticed.
> 

Fixes: 8f75aa496dcb ("net: reply to ping requests")

Isn't it?

> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  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 622acbe40d..e8e8dad5bd 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -571,7 +571,7 @@ int phy_wait_aneg_done(struct phy_device *phydev)
>  	}
>  
>  	do {
> -		genphy_update_link(phydev);
> +		phy_update_status(phydev);
>  		if (phydev->link == 1)
>  			return 0;
>  	} while (!is_timeout(start, PHY_AN_TIMEOUT * SECOND));
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-03-12 10:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 10:13 Sascha Hauer
2021-03-12 10:23 ` Ahmad Fatoum [this message]
2021-03-15  9:24   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdfda15d-cdcd-19a7-a874-98c0b2b3c89c@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox