ixgbe: Fix CS4227-related semaphore error on reset failure
[deliverable/linux.git] / drivers / net / ethernet / intel / ixgbe / ixgbe_x550.c
index ed7b2899affe03bbaf922ad3d4a1e48e59a663ff..06b15eddc4ae307e5014f3cb79270b37f0cece5c 100644 (file)
@@ -198,6 +198,7 @@ static s32 ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value)
  * ixgbe_reset_cs4227 - Reset CS4227 using port expander
  * @hw: pointer to hardware structure
  *
+ * This function assumes that the caller has acquired the proper semaphore.
  * Returns error code
  */
 static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw)
@@ -296,6 +297,14 @@ static void ixgbe_check_cs4227(struct ixgbe_hw *hw)
                hw->mac.ops.release_swfw_sync(hw, swfw_mask);
                msleep(IXGBE_CS4227_CHECK_DELAY);
        }
+       /* If still pending, assume other instance failed. */
+       if (retry == IXGBE_CS4227_RETRIES) {
+               status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
+               if (status) {
+                       hw_err(hw, "semaphore failed with %d\n", status);
+                       return;
+               }
+       }
 
        /* Reset the CS4227. */
        status = ixgbe_reset_cs4227(hw);
This page took 0.027615 seconds and 5 git commands to generate.