aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x
diff options
context:
space:
mode:
authorVladislav Zolotarov <vladz@broadcom.com>2011-07-23 23:57:46 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-24 16:11:40 -0400
commitb1fb8740a279a96d8b6ceedfce334b887908b91d (patch)
treeddba2e7d62adcca31212011dfb9ac9dd3eae9769 /drivers/net/bnx2x
parent2189400b3c29a03360cbe2e3af3299eb5e2b950c (diff)
bnx2x: fix bnx2x_stop_on_error flow in bnx2x_sp_rtnl_task
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x')
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 734de9a96c75..e5d5d4fb1de5 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -8413,31 +8413,45 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
8413 if (!netif_running(bp->dev)) 8413 if (!netif_running(bp->dev))
8414 goto sp_rtnl_exit; 8414 goto sp_rtnl_exit;
8415 8415
8416 if (test_and_clear_bit(BNX2X_SP_RTNL_SETUP_TC, &bp->sp_rtnl_state))
8417 bnx2x_setup_tc(bp->dev, bp->dcbx_port_params.ets.num_of_cos);
8418
8419 /* if stop on error is defined no recovery flows should be executed */ 8416 /* if stop on error is defined no recovery flows should be executed */
8420#ifdef BNX2X_STOP_ON_ERROR 8417#ifdef BNX2X_STOP_ON_ERROR
8421 BNX2X_ERR("recovery flow called but STOP_ON_ERROR defined " 8418 BNX2X_ERR("recovery flow called but STOP_ON_ERROR defined "
8422 "so reset not done to allow debug dump,\n" 8419 "so reset not done to allow debug dump,\n"
8423 "you will need to reboot when done\n"); 8420 "you will need to reboot when done\n");
8424 goto sp_rtnl_exit; 8421 goto sp_rtnl_not_reset;
8425#endif 8422#endif
8426 8423
8427 if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) { 8424 if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) {
8428 /* 8425 /*
8429 * Clear TX_TIMEOUT bit as we are going to reset the function 8426 * Clear all pending SP commands as we are going to reset the
8430 * anyway. 8427 * function anyway.
8431 */ 8428 */
8432 smp_mb__before_clear_bit(); 8429 bp->sp_rtnl_state = 0;
8433 clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state); 8430 smp_mb();
8434 smp_mb__after_clear_bit(); 8431
8435 bnx2x_parity_recover(bp); 8432 bnx2x_parity_recover(bp);
8436 } else if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, 8433
8437 &bp->sp_rtnl_state)){ 8434 goto sp_rtnl_exit;
8435 }
8436
8437 if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state)) {
8438 /*
8439 * Clear all pending SP commands as we are going to reset the
8440 * function anyway.
8441 */
8442 bp->sp_rtnl_state = 0;
8443 smp_mb();
8444
8438 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 8445 bnx2x_nic_unload(bp, UNLOAD_NORMAL);
8439 bnx2x_nic_load(bp, LOAD_NORMAL); 8446 bnx2x_nic_load(bp, LOAD_NORMAL);
8447
8448 goto sp_rtnl_exit;
8440 } 8449 }
8450#ifdef BNX2X_STOP_ON_ERROR
8451sp_rtnl_not_reset:
8452#endif
8453 if (test_and_clear_bit(BNX2X_SP_RTNL_SETUP_TC, &bp->sp_rtnl_state))
8454 bnx2x_setup_tc(bp->dev, bp->dcbx_port_params.ets.num_of_cos);
8441 8455
8442sp_rtnl_exit: 8456sp_rtnl_exit:
8443 rtnl_unlock(); 8457 rtnl_unlock();