i40e: Add delay after EMP reset for firmware to recover
authorFilip Sadowski <filip.sadowski@intel.com>
Fri, 29 Dec 2017 13:50:05 +0000 (08:50 -0500)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 12 Feb 2018 18:38:38 +0000 (10:38 -0800)
This patch adds necessary delay for 4.33 firmware to recover after
EMP reset. Without this patch driver occasionally reinitializes
structures too quickly to communicate with firmware after EMP reset
causing AdminQ to timeout.

Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 005a6d6a20fb870b878527547be708dc270b647a..a88fdb8bf5f028af96cea0fd8fc056dc7442fa18 100644 (file)
@@ -9215,6 +9215,17 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
        }
        i40e_get_oem_version(&pf->hw);
 
+       if (test_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state) &&
+           ((hw->aq.fw_maj_ver == 4 && hw->aq.fw_min_ver <= 33) ||
+            hw->aq.fw_maj_ver < 4) && hw->mac.type == I40E_MAC_XL710) {
+               /* The following delay is necessary for 4.33 firmware and older
+                * to recover after EMP reset. 200 ms should suffice but we
+                * put here 300 ms to be sure that FW is ready to operate
+                * after reset.
+                */
+               mdelay(300);
+       }
+
        /* re-verify the eeprom if we just had an EMP reset */
        if (test_and_clear_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state))
                i40e_verify_eeprom(pf);