diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2014-03-19 09:16:26 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-19 23:06:19 -0700 |
commit | f8cf7a00d82b6c7b984adc917199cb63552957fb (patch) | |
tree | b773e463c8fe12f273f61f8ef016aae202385154 /drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | |
parent | 0933ce4a9d68ae35dccfa592fa361c149df5d1af (diff) | |
download | talos-obmc-linux-f8cf7a00d82b6c7b984adc917199cb63552957fb.tar.gz talos-obmc-linux-f8cf7a00d82b6c7b984adc917199cb63552957fb.zip |
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_82599.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c index 3bc9b6718875..572cce47797c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c @@ -210,7 +210,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { ret_val = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); - if (!ret_val) + if (ret_val) return IXGBE_ERR_SWFW_SYNC; *locked = true; @@ -245,8 +245,10 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) { ret_val = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); - if (!ret_val) + if (ret_val) return IXGBE_ERR_SWFW_SYNC; + + locked = true; } IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); @@ -1094,7 +1096,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, if (autoc != start_autoc) { /* Restart link */ status = hw->mac.ops.prot_autoc_write(hw, autoc, false); - if (!status) + if (status) goto out; /* Only poll for autoneg to complete if specified to do so */ @@ -1277,7 +1279,7 @@ mac_reset_top: status = hw->mac.ops.prot_autoc_write(hw, hw->mac.orig_autoc, false); - if (!status) + if (status) goto reset_hw_out; } |