From: Krzysztof Galazka <krzysztof.gala...@intel.com>

When user changed advertised speed settings and link was already up
driver asked FW only for active PHY configuration. This prevented it from
adding speeds, which are supported but was earlier disabled by user. Get
all speeds supported by HW to allow user enabling any of them.

Signed-off-by: Krzysztof Galazka <krzysztof.gala...@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c 
b/drivers/net/ixgbe/base/ixgbe_e610.c
index b9b1ba32c3..6eaf377f4a 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -4342,7 +4342,8 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
 {
        struct ixgbe_aci_cmd_get_phy_caps_data pcaps;
        struct ixgbe_aci_cmd_set_phy_cfg_data pcfg;
-       u8 rmode = IXGBE_ACI_REPORT_ACTIVE_CFG;
+       u8 rmode = IXGBE_ACI_REPORT_TOPO_CAP_MEDIA;
+       u64 sup_phy_type_low, sup_phy_type_high;
        s32 rc;
 
        rc = ixgbe_aci_get_link_info(hw, false, NULL);
@@ -4359,6 +4360,15 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
                goto err;
        }
 
+       sup_phy_type_low = pcaps.phy_type_low;
+       sup_phy_type_high = pcaps.phy_type_high;
+
+       /* Get Active configuration to avoid unintended changes */
+       rc = ixgbe_aci_get_phy_caps(hw, false, IXGBE_ACI_REPORT_ACTIVE_CFG,
+                                   &pcaps);
+       if (rc) {
+               goto err;
+       }
        ixgbe_copy_phy_caps_to_cfg(&pcaps, &pcfg);
 
        /* Set default PHY types for a given speed */
@@ -4406,8 +4416,8 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
        }
 
        /* Mask the set values to avoid requesting unsupported link types */
-       pcfg.phy_type_low &= pcaps.phy_type_low;
-       pcfg.phy_type_high &= pcaps.phy_type_high;
+       pcfg.phy_type_low &= sup_phy_type_low;
+       pcfg.phy_type_high &= sup_phy_type_high;
 
        if (pcfg.phy_type_high != pcaps.phy_type_high ||
            pcfg.phy_type_low != pcaps.phy_type_low ||
-- 
2.43.5

Reply via email to