summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Marginean <alexandru.marginean@nxp.com>2019-11-14 18:28:35 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2019-12-09 09:47:43 -0600
commit6d9bc2043a5ee95bebbe57dfe6c034d60a607a7b (patch)
treea649fa0d11830ca5766031f4a78bfc9127330f40 /drivers
parent05f86070c0722015520ceb172b22070db5d0aa35 (diff)
downloadu-boot-6d9bc2043a5ee95bebbe57dfe6c034d60a607a7b.tar.gz
u-boot-6d9bc2043a5ee95bebbe57dfe6c034d60a607a7b.tar.xz
u-boot-6d9bc2043a5ee95bebbe57dfe6c034d60a607a7b.zip
drivers: net: aquantia: check system interface too when checking for link up
In some cases the link on the system interface of the aquantia PHY comes up after the link on line interface. The link state loop only checks the line side, which may result in first packet sent being lost. Use aquantia_link_is_up instead, which checks both system and line side on gen 2/3 PHYs to avoid losing the 1st packet. Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/aquantia.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 3992a97712..c4bd443001 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -555,17 +555,14 @@ int aquantia_startup(struct phy_device *phydev)
phydev->duplex = DUPLEX_FULL;
/* if the AN is still in progress, wait till timeout. */
- phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
- reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
- if (!(reg & MDIO_AN_STAT1_COMPLETE)) {
+ if (!aquantia_link_is_up(phydev)) {
printf("%s Waiting for PHY auto negotiation to complete",
phydev->dev->name);
do {
udelay(1000);
- reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
if ((i++ % 500) == 0)
printf(".");
- } while (!(reg & MDIO_AN_STAT1_COMPLETE) &&
+ } while (!aquantia_link_is_up(phydev) &&
i < (4 * PHY_ANEG_TIMEOUT));
if (i > PHY_ANEG_TIMEOUT)