diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2014-03-19 05:16:26 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-20 02:06:19 -0400 |
commit | f8cf7a00d82b6c7b984adc917199cb63552957fb (patch) | |
tree | b773e463c8fe12f273f61f8ef016aae202385154 | |
parent | 0933ce4a9d68ae35dccfa592fa361c149df5d1af (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 10 |
2 files changed, 11 insertions, 9 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, | |||
210 | if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { | 210 | if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { |
211 | ret_val = hw->mac.ops.acquire_swfw_sync(hw, | 211 | ret_val = hw->mac.ops.acquire_swfw_sync(hw, |
212 | IXGBE_GSSR_MAC_CSR_SM); | 212 | IXGBE_GSSR_MAC_CSR_SM); |
213 | if (!ret_val) | 213 | if (ret_val) |
214 | return IXGBE_ERR_SWFW_SYNC; | 214 | return IXGBE_ERR_SWFW_SYNC; |
215 | 215 | ||
216 | *locked = true; | 216 | *locked = true; |
@@ -245,8 +245,10 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) | |||
245 | if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) { | 245 | if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) { |
246 | ret_val = hw->mac.ops.acquire_swfw_sync(hw, | 246 | ret_val = hw->mac.ops.acquire_swfw_sync(hw, |
247 | IXGBE_GSSR_MAC_CSR_SM); | 247 | IXGBE_GSSR_MAC_CSR_SM); |
248 | if (!ret_val) | 248 | if (ret_val) |
249 | return IXGBE_ERR_SWFW_SYNC; | 249 | return IXGBE_ERR_SWFW_SYNC; |
250 | |||
251 | locked = true; | ||
250 | } | 252 | } |
251 | 253 | ||
252 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); | 254 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); |
@@ -1094,7 +1096,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, | |||
1094 | if (autoc != start_autoc) { | 1096 | if (autoc != start_autoc) { |
1095 | /* Restart link */ | 1097 | /* Restart link */ |
1096 | status = hw->mac.ops.prot_autoc_write(hw, autoc, false); | 1098 | status = hw->mac.ops.prot_autoc_write(hw, autoc, false); |
1097 | if (!status) | 1099 | if (status) |
1098 | goto out; | 1100 | goto out; |
1099 | 1101 | ||
1100 | /* Only poll for autoneg to complete if specified to do so */ | 1102 | /* Only poll for autoneg to complete if specified to do so */ |
@@ -1277,7 +1279,7 @@ mac_reset_top: | |||
1277 | status = hw->mac.ops.prot_autoc_write(hw, | 1279 | status = hw->mac.ops.prot_autoc_write(hw, |
1278 | hw->mac.orig_autoc, | 1280 | hw->mac.orig_autoc, |
1279 | false); | 1281 | false); |
1280 | if (!status) | 1282 | if (status) |
1281 | goto reset_hw_out; | 1283 | goto reset_hw_out; |
1282 | } | 1284 | } |
1283 | 1285 | ||
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) | |||
143 | case ixgbe_media_type_backplane: | 143 | case ixgbe_media_type_backplane: |
144 | /* some MAC's need RMW protection on AUTOC */ | 144 | /* some MAC's need RMW protection on AUTOC */ |
145 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, ®_bp); | 145 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, ®_bp); |
146 | if (!ret_val) | 146 | if (ret_val) |
147 | goto out; | 147 | goto out; |
148 | 148 | ||
149 | /* only backplane uses autoc so fall though */ | 149 | /* only backplane uses autoc so fall though */ |
@@ -2723,14 +2723,14 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index) | |||
2723 | 2723 | ||
2724 | if (!link_up) { | 2724 | if (!link_up) { |
2725 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); | 2725 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); |
2726 | if (!ret_val) | 2726 | if (ret_val) |
2727 | goto out; | 2727 | goto out; |
2728 | 2728 | ||
2729 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; | 2729 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; |
2730 | autoc_reg |= IXGBE_AUTOC_FLU; | 2730 | autoc_reg |= IXGBE_AUTOC_FLU; |
2731 | 2731 | ||
2732 | ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); | 2732 | ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); |
2733 | if (!ret_val) | 2733 | if (ret_val) |
2734 | goto out; | 2734 | goto out; |
2735 | 2735 | ||
2736 | IXGBE_WRITE_FLUSH(hw); | 2736 | IXGBE_WRITE_FLUSH(hw); |
@@ -2760,14 +2760,14 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index) | |||
2760 | bool locked = false; | 2760 | bool locked = false; |
2761 | 2761 | ||
2762 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); | 2762 | ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); |
2763 | if (!ret_val) | 2763 | if (ret_val) |
2764 | goto out; | 2764 | goto out; |
2765 | 2765 | ||
2766 | autoc_reg &= ~IXGBE_AUTOC_FLU; | 2766 | autoc_reg &= ~IXGBE_AUTOC_FLU; |
2767 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; | 2767 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; |
2768 | 2768 | ||
2769 | ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); | 2769 | ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); |
2770 | if (!ret_val) | 2770 | if (ret_val) |
2771 | goto out; | 2771 | goto out; |
2772 | 2772 | ||
2773 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | 2773 | led_reg &= ~IXGBE_LED_MODE_MASK(index); |