Message ID | 20240821055906.27717-2-Divya.Koppera@microchip.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d4c897675a5a9f41a3f2c964d84e93bca5367f7a |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Adds support for lan887x phy | expand |
On Wed, Aug 21, 2024 at 11:29:05AM +0530, Divya Koppera wrote: > From: Divya Koppera <divya.koppera@microchip.com> > > Adds support in phy library to accept autoneg configuration only when > feature is enabled in supported list. > > Signed-off-by: Divya Koppera <divya.koppera@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 785182fa5fe0..cba3af926429 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1089,7 +1089,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev, if (autoneg != AUTONEG_ENABLE && autoneg != AUTONEG_DISABLE) return -EINVAL; - if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising)) + if (autoneg == AUTONEG_ENABLE && + (linkmode_empty(advertising) || + !linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + phydev->supported))) return -EINVAL; if (autoneg == AUTONEG_DISABLE &&