Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb686231 authored by Mugunthan V N's avatar Mugunthan V N Committed by David S. Miller
Browse files

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: default avatarMugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4fdeddfe
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -796,9 +796,10 @@ 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;
	}

	err = phy_write(phydev, MII_CTRL1000, adv);
	if (err < 0)