summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2015-06-25 22:21:02 +0530
committerSasha Levin <sasha.levin@oracle.com>2015-07-05 10:13:00 -0400
commitf5437d06e0894775086485c97b9069e123fe6961 (patch)
treea727e6d7ad41a49f79dc8af4a81c0f6c3cfaf52c /drivers
parent83152d40c1cf5db8b70e1d64b599b7b709063131 (diff)
net: phy: fix phy link up when limiting speed via device tree
[ Upstream commit eb686231fce3770299760f24fdcf5ad041f44153 ] When limiting phy link speed using "max-speed" to 100mbps or less on a giga bit phy, phy never completes auto negotiation and phy state machine is held in PHY_AN. Fixing this issue by comparing the giga bit advertise though phydev->supported doesn't have it but phy has BMSR_ESTATEN set. So that auto negotiation is restarted as old and new advertise are different and link comes up fine. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phy_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3fc91e89f5a5..70a0d88de654 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -782,10 +782,11 @@ static int genphy_config_advert(struct phy_device *phydev)
if (phydev->supported & (SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full)) {
adv |= ethtool_adv_to_mii_ctrl1000_t(advertise);
- if (adv != oldadv)
- changed = 1;
}
+ if (adv != oldadv)
+ changed = 1;
+
err = phy_write(phydev, MII_CTRL1000, adv);
if (err < 0)
return err;