i40e: Revert ShadowRAM checksum calculation change
authorMaciej Paczkowski <maciej.paczkowski@intel.com>
Fri, 29 Mar 2019 22:08:40 +0000 (15:08 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 5 May 2019 00:30:58 +0000 (17:30 -0700)
The reason of this revert is unexpected issue found in NVM Update tool
during NVM image downgrade. The implementation is no longer needed
since the QV tools are already aware of new FW double ShadowRAM dump
mechanism.

This patch reverts ShadowRAM checksum calculation change introduced in
commit 9d12f0c4e436 ("i40e: Revert ShadowRAM checksum calculation change")

Signed-off-by: Maciej Paczkowski <maciej.paczkowski@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_nvm.c

index ee89779a9a6f09d3234d3e4bc9e9d8704e413b46..c508b75c3c09e172431532d67621a07a27b4c9c3 100644 (file)
@@ -574,36 +574,14 @@ i40e_calc_nvm_checksum_exit:
 i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw)
 {
        i40e_status ret_code;
-       u16 checksum, checksum_sr;
+       u16 checksum;
        __le16 le_sum;
 
        ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-       if (ret_code)
-               return ret_code;
-
        le_sum = cpu_to_le16(checksum);
-       ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
-                                    1, &le_sum, true);
-       if (ret_code)
-               return ret_code;
-
-       /* Due to changes in FW the SW is required to perform double SR-dump
-        * in some cases. SR-dump is the process when internal shadow RAM is
-        * dumped into flash bank. It is triggered by setting "last_command"
-        * argument in i40e_write_nvm_aq function call.
-        * Since FW 1.8 we need to calculate SR checksum again and update it
-        * in flash if it is not equal to previously computed checksum.
-        * This situation would occur only in FW >= 1.8
-        */
-       ret_code = i40e_calc_nvm_checksum(hw, &checksum_sr);
-       if (ret_code)
-               return ret_code;
-       if (checksum_sr != checksum) {
-               le_sum = cpu_to_le16(checksum_sr);
-               ret_code = i40e_write_nvm_aq(hw, 0x00,
-                                            I40E_SR_SW_CHECKSUM_WORD,
+       if (!ret_code)
+               ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
                                             1, &le_sum, true);
-       }
 
        return ret_code;
 }