Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mugunthan V N and committed by
David S. Miller
eb686231 4fdeddfe

+3 -2
+3 -2
drivers/net/phy/phy_device.c
··· 796 796 if (phydev->supported & (SUPPORTED_1000baseT_Half | 797 797 SUPPORTED_1000baseT_Full)) { 798 798 adv |= ethtool_adv_to_mii_ctrl1000_t(advertise); 799 - if (adv != oldadv) 800 - changed = 1; 801 799 } 800 + 801 + if (adv != oldadv) 802 + changed = 1; 802 803 803 804 err = phy_write(phydev, MII_CTRL1000, adv); 804 805 if (err < 0)