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>
This commit is contained in:
Родитель
0933ce4a9d
Коммит
f8cf7a00d8
|
@ -210,7 +210,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked,
|
||||||
if (ixgbe_verify_lesm_fw_enabled_82599(hw)) {
|
if (ixgbe_verify_lesm_fw_enabled_82599(hw)) {
|
||||||
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
||||||
IXGBE_GSSR_MAC_CSR_SM);
|
IXGBE_GSSR_MAC_CSR_SM);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
return IXGBE_ERR_SWFW_SYNC;
|
return IXGBE_ERR_SWFW_SYNC;
|
||||||
|
|
||||||
*locked = true;
|
*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)) {
|
if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) {
|
||||||
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
||||||
IXGBE_GSSR_MAC_CSR_SM);
|
IXGBE_GSSR_MAC_CSR_SM);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
return IXGBE_ERR_SWFW_SYNC;
|
return IXGBE_ERR_SWFW_SYNC;
|
||||||
|
|
||||||
|
locked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
|
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) {
|
if (autoc != start_autoc) {
|
||||||
/* Restart link */
|
/* Restart link */
|
||||||
status = hw->mac.ops.prot_autoc_write(hw, autoc, false);
|
status = hw->mac.ops.prot_autoc_write(hw, autoc, false);
|
||||||
if (!status)
|
if (status)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Only poll for autoneg to complete if specified to do so */
|
/* 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,
|
status = hw->mac.ops.prot_autoc_write(hw,
|
||||||
hw->mac.orig_autoc,
|
hw->mac.orig_autoc,
|
||||||
false);
|
false);
|
||||||
if (!status)
|
if (status)
|
||||||
goto reset_hw_out;
|
goto reset_hw_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ static s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
|
||||||
case ixgbe_media_type_backplane:
|
case ixgbe_media_type_backplane:
|
||||||
/* some MAC's need RMW protection on AUTOC */
|
/* some MAC's need RMW protection on AUTOC */
|
||||||
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, ®_bp);
|
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, ®_bp);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* only backplane uses autoc so fall though */
|
/* 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) {
|
if (!link_up) {
|
||||||
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
||||||
autoc_reg |= IXGBE_AUTOC_FLU;
|
autoc_reg |= IXGBE_AUTOC_FLU;
|
||||||
|
|
||||||
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
|
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
IXGBE_WRITE_FLUSH(hw);
|
IXGBE_WRITE_FLUSH(hw);
|
||||||
|
@ -2760,14 +2760,14 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
|
||||||
bool locked = false;
|
bool locked = false;
|
||||||
|
|
||||||
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
autoc_reg &= ~IXGBE_AUTOC_FLU;
|
autoc_reg &= ~IXGBE_AUTOC_FLU;
|
||||||
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
||||||
|
|
||||||
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
|
ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked);
|
||||||
if (!ret_val)
|
if (ret_val)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче