diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2015-06-25 12:51:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-10 12:49:31 -0400 |
commit | 6c10c84170c40bf3d4a9953ae5a2ffe59ad736d4 (patch) | |
tree | 5ce9644918052bd67869b726c2a07f00aacef86b /drivers | |
parent | 62a9ad17a245002cc611fc4667c2919ef422d8ee (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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/phy_device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index bdfe51fc3a65..d551df62e61a 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -796,10 +796,11 @@ static int genphy_config_advert(struct phy_device *phydev) | |||
796 | if (phydev->supported & (SUPPORTED_1000baseT_Half | | 796 | if (phydev->supported & (SUPPORTED_1000baseT_Half | |
797 | SUPPORTED_1000baseT_Full)) { | 797 | SUPPORTED_1000baseT_Full)) { |
798 | adv |= ethtool_adv_to_mii_ctrl1000_t(advertise); | 798 | adv |= ethtool_adv_to_mii_ctrl1000_t(advertise); |
799 | if (adv != oldadv) | ||
800 | changed = 1; | ||
801 | } | 799 | } |
802 | 800 | ||
801 | if (adv != oldadv) | ||
802 | changed = 1; | ||
803 | |||
803 | err = phy_write(phydev, MII_CTRL1000, adv); | 804 | err = phy_write(phydev, MII_CTRL1000, adv); |
804 | if (err < 0) | 805 | if (err < 0) |
805 | return err; | 806 | return err; |