From 008cb5bdb6136406d00917a3b7aef8fcb6d0e879 Mon Sep 17 00:00:00 2001 From: Vladislav Zolotarov Date: Sun, 24 Jul 2011 03:57:46 +0000 Subject: [PATCH] --- yaml --- r: 258571 b: refs/heads/master c: b1fb8740a279a96d8b6ceedfce334b887908b91d h: refs/heads/master i: 258569: 555e37c6192e478e2ea6ad6ba041abf0fa976224 258567: 334efe62cae147c9f879c12b57a7a23510d60aff v: v3 --- [refs] | 2 +- trunk/drivers/net/bnx2x/bnx2x_main.c | 36 +++++++++++++++++++--------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 543e4563ba52..7cd2c42f1202 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2189400b3c29a03360cbe2e3af3299eb5e2b950c +refs/heads/master: b1fb8740a279a96d8b6ceedfce334b887908b91d diff --git a/trunk/drivers/net/bnx2x/bnx2x_main.c b/trunk/drivers/net/bnx2x/bnx2x_main.c index 734de9a96c75..e5d5d4fb1de5 100644 --- a/trunk/drivers/net/bnx2x/bnx2x_main.c +++ b/trunk/drivers/net/bnx2x/bnx2x_main.c @@ -8413,31 +8413,45 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work) if (!netif_running(bp->dev)) goto sp_rtnl_exit; - if (test_and_clear_bit(BNX2X_SP_RTNL_SETUP_TC, &bp->sp_rtnl_state)) - bnx2x_setup_tc(bp->dev, bp->dcbx_port_params.ets.num_of_cos); - /* if stop on error is defined no recovery flows should be executed */ #ifdef BNX2X_STOP_ON_ERROR BNX2X_ERR("recovery flow called but STOP_ON_ERROR defined " "so reset not done to allow debug dump,\n" "you will need to reboot when done\n"); - goto sp_rtnl_exit; + goto sp_rtnl_not_reset; #endif if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) { /* - * Clear TX_TIMEOUT bit as we are going to reset the function - * anyway. + * Clear all pending SP commands as we are going to reset the + * function anyway. */ - smp_mb__before_clear_bit(); - clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state); - smp_mb__after_clear_bit(); + bp->sp_rtnl_state = 0; + smp_mb(); + bnx2x_parity_recover(bp); - } else if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, - &bp->sp_rtnl_state)){ + + goto sp_rtnl_exit; + } + + if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state)) { + /* + * Clear all pending SP commands as we are going to reset the + * function anyway. + */ + bp->sp_rtnl_state = 0; + smp_mb(); + bnx2x_nic_unload(bp, UNLOAD_NORMAL); bnx2x_nic_load(bp, LOAD_NORMAL); + + goto sp_rtnl_exit; } +#ifdef BNX2X_STOP_ON_ERROR +sp_rtnl_not_reset: +#endif + if (test_and_clear_bit(BNX2X_SP_RTNL_SETUP_TC, &bp->sp_rtnl_state)) + bnx2x_setup_tc(bp->dev, bp->dcbx_port_params.ets.num_of_cos); sp_rtnl_exit: rtnl_unlock();