Skip to content

Commit

Permalink
net: phy: marvell10g: check for newly set aneg
Browse files Browse the repository at this point in the history
Even if the advertisement registers content didn't change, we may have
just switched to aneg, and therefore have to trigger an aneg restart.
This matches the behavior of genphy_config_aneg().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Feb 17, 2019
1 parent 3de97f3 commit 3ce2a02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/phy/marvell10g.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,16 @@ static int mv3310_config_aneg(struct phy_device *phydev)
if (ret > 0)
changed = true;

if (!changed) {
/* Configure and restart aneg if it wasn't set before */
ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
if (ret < 0)
return ret;

if (!(ret & MDIO_AN_CTRL1_ENABLE))
changed = 1;
}

if (changed)
ret = genphy_c45_restart_aneg(phydev);

Expand Down

0 comments on commit 3ce2a02

Please sign in to comment.