net: phy: fix phy link up when limiting speed via device tree
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>
This commit is contained in:
parent
4fdeddfe04
commit
eb686231fc
1 changed files with 3 additions and 2 deletions
|
@ -796,10 +796,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;
|
||||
|
|
Loading…
Reference in a new issue