Skip to contentSkip to conversation

net: phy: don't set autoneg if it's not supported

PATCH Applied Heiner Kallweit 2 participants 2 messages Apr 16, 2019 – Apr 18, 2019

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/phy/phy_device.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/phy/phy_device.c +4 -0
index 5eb905ab5..2d2b654e8 100644
@@ -2158,6 +2158,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;
Signature · 1 line
2.21.0
maintainer Applied
#1 lore raw

From: Heiner Kallweit <[email protected]>
Date: Tue, 16 Apr 2019 23:54:00 +0200

Quoted 8 lines

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.

Applied.