diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-03-12 11:05:38 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-03-12 11:05:51 +0100 |
commit | 393a15eb5019e699e6dce9f2961d65acbf936fe0 (patch) | |
tree | 63aef3ca9a69b6dee4d595eb7a180155d5f4f4b6 /drivers/net/phy/phy.c | |
parent | 4458d4eae4062f67a241d8bd44e90f5d53420382 (diff) | |
download | barebox-393a15eb5019e699e6dce9f2961d65acbf936fe0.tar.gz barebox-393a15eb5019e699e6dce9f2961d65acbf936fe0.tar.xz |
net: phy: fix waiting for link
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.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |