ice_set_link_ksettings() rejects autoneg requests by comparing user settings against safe_ks which is populated by ice_phy_type_to_ethtool(). The Autoneg bit in safe_ks is set only if the current PHY configuration reports it supported, but this misses PHYs that support autoneg and have it available through PHY capabilities. Pull the autoneg flag from the actual PHY capabilities (already fetched earlier in the function) to ensure the user can toggle autoneg on any capable PHY. Fixes: 5cd349c349d6 ("ice: report supported and advertised autoneg using PHY capabilities") Cc: stable@vger.kernel.org Signed-off-by: Jan Glaza Signed-off-by: Aleksandr Loktionov --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index 49b9376..44483bc 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -2654,6 +2654,14 @@ ice_set_link_ksettings(struct net_device *netdev, /* Get link modes supported by hardware.*/ ice_phy_type_to_ethtool(netdev, &safe_ks); + /* Pull the value of autoneg from phy caps to ensure we allow + * toggling it on all PHYs that support it. + */ + if (ice_is_phy_caps_an_enabled(phy_caps)) { + ethtool_link_ksettings_add_link_mode(&safe_ks, supported, Autoneg); + set_bit(ETHTOOL_LINK_MODE_FEC_NONE_BIT, safe_ks.link_modes.supported); + } + /* and check against modes requested by user. * Return an error if unsupported mode was set. */ -- 2.52.0