summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2014-03-19 13:16:26 +0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-20 10:06:19 +0400
commitf8cf7a00d82b6c7b984adc917199cb63552957fb (patch)
treeb773e463c8fe12f273f61f8ef016aae202385154 /drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
parent0933ce4a9d68ae35dccfa592fa361c149df5d1af (diff)
downloadlinux-f8cf7a00d82b6c7b984adc917199cb63552957fb.tar.xz
ixgbe: fix errors related to protected AUTOC calls
Found several incorrect conditionals after calling the prot_autoc_* functions. Likewise we weren't always freeing the FWSW semaphore after grabbing it. This would lead to DA cables being unable to link along with possible other errors. CC: Arun Sharma <asharma@fb.com> CC: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_common.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 6149c6574106..38ca24079980 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -143,7 +143,7 @@ static s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
case ixgbe_media_type_backplane:
/* some MAC's need RMW protection on AUTOC */
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &reg_bp);
- if (!ret_val)
+ if (ret_val)
goto out;
/* only backplane uses autoc so fall though */
@@ -2723,14 +2723,14 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
if (!link_up) {
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
- if (!ret_val)
+ if (ret_val)
goto out;
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
autoc_reg |= IXGBE_AUTOC_FLU;
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
- if (!ret_val)
+ if (ret_val)
goto out;
IXGBE_WRITE_FLUSH(hw);
@@ -2760,14 +2760,14 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
bool locked = false;
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
- if (!ret_val)
+ if (ret_val)
goto out;
autoc_reg &= ~IXGBE_AUTOC_FLU;
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
- if (!ret_val)
+ if (ret_val)
goto out;
led_reg &= ~IXGBE_LED_MODE_MASK(index);