diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-04-16 23:54:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-18 16:10:27 -0700 |
commit | 5e42574b022b2640304530c68912ee638c6d9a20 (patch) | |
tree | 1793b3dc22b414d24669b643ba7a4b60121a3a31 /drivers/net/phy | |
parent | 16111991dbd72407566ac29acf7892cd15c85bd9 (diff) |
net: phy: don't set autoneg if it's not supported
In phy_device_create() we set phydev->autoneg = 1. This isn't changed
even if the PHY doesn't support autoneg. This seems to affect very
few PHY's, and they disable phydev->autoneg in their config_init
callback. So it's more of an improvement, therefore net-next.
The patch also wouldn't apply to older kernel versions because the
link mode bitmaps have been introduced recently.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy_device.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 48adb3d1f1ee..b9192ae92e40 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2149,6 +2149,10 @@ static int phy_probe(struct device *dev) if (err) goto out; + if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + phydev->supported)) + phydev->autoneg = 0; + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, phydev->supported)) phydev->is_gigabit_capable = 1; |