ixgbe: Correct error path in semaphore handling
authorMark Rustad <mark.d.rustad@intel.com>
Sat, 8 Aug 2015 23:18:59 +0000 (16:18 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 24 Sep 2015 05:48:10 +0000 (22:48 -0700)
The timeout path is supposed to release the semaphore, so do that.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c

index ccf853f7b73e139e7ef9eafc081a6fb680dc9ca8..c1d4584f6469df00e9b12d9254f6c2e17bd1070f 100644 (file)
@@ -711,6 +711,11 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw)
                usleep_range(50, 100);
        }
 
+       /* Release semaphores and return error if SW NVM semaphore
+        * was not granted because we do not have access to the EEPROM
+        */
+       hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n");
+       ixgbe_release_swfw_sync_semaphore(hw);
        return IXGBE_ERR_EEPROM;
 }