]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i40e: Fix autoneg disabling for non-10GBaseT links
authorMateusz Palczewski <mateusz.palczewski@intel.com>
Wed, 10 Mar 2021 11:12:54 +0000 (11:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:00:02 +0000 (17:00 +0200)
[ Upstream commit 9262793e59f0423437166a879a73d056b1fe6f9a ]

Disabling autonegotiation was allowed only for 10GBaseT PHY.
The condition was changed to check if link media type is BaseT.

Fixes: 3ce12ee9d8f9 ("i40e: Fix order of checks when enabling/disabling autoneg in ethtool")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Karen Sornek <karen.sornek@intel.com>
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c

index 93dd58fda272ff45e1640dcf0613b8481121fa62..d558364e3a9fb41fc250f4f555e1559bceb2555d 100644 (file)
@@ -1262,8 +1262,7 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
                        if (ethtool_link_ksettings_test_link_mode(&safe_ks,
                                                                  supported,
                                                                  Autoneg) &&
-                           hw->phy.link_info.phy_type !=
-                           I40E_PHY_TYPE_10GBASE_T) {
+                           hw->phy.media_type != I40E_MEDIA_TYPE_BASET) {
                                netdev_info(netdev, "Autoneg cannot be disabled on this phy\n");
                                err = -EINVAL;
                                goto done;