diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-02-17 10:32:29 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-17 10:26:52 -0800 |
commit | 3ce2a027ae4e3ede876da6913641ad37c33b698b (patch) | |
tree | 27ed80285ee6e8fbc0cbee4277be5a4ae6e7293d /drivers/net | |
parent | 3de97f3c630850caf0fff67555bbe3f7ba61c308 (diff) |
net: phy: marvell10g: check for newly set aneg
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/marvell10g.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 8955740832cc..b83eb19cf8bb 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -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); |