diff options
author | Ariel Elior <ariele@broadcom.com> | 2011-07-14 04:31:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-14 19:02:29 -0400 |
commit | 7be08a7222c345798b0697a89ea3dd2c7c83f47c (patch) | |
tree | ac88d5d5595ffd21fce1af25ecadc1e218f719b9 /drivers/net/bnx2x/bnx2x_main.c | |
parent | 39770653ca4423562e88726a629886c41139610b (diff) |
bnx2x: Renaming the "reset_task" to "sp_rtnl_task"
Renaming the "reset_task" to a more general purpose name,
"sp_rtnl_task", as it is already used for another purpose
other than reset which is parity recovery, and since I
plan to add a third operation for this task, updating the
priority to traffic class and traffic class to transmission
queues mappings after dcbx negotiation takes place.
Signed-off-by: Ariel Elior <ariele@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/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 5b4a8f34b13c..53f4ec3d1d9e 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -4020,7 +4020,7 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted) | |||
4020 | if (bnx2x_chk_parity_attn(bp, &global, true)) { | 4020 | if (bnx2x_chk_parity_attn(bp, &global, true)) { |
4021 | #ifndef BNX2X_STOP_ON_ERROR | 4021 | #ifndef BNX2X_STOP_ON_ERROR |
4022 | bp->recovery_state = BNX2X_RECOVERY_INIT; | 4022 | bp->recovery_state = BNX2X_RECOVERY_INIT; |
4023 | schedule_delayed_work(&bp->reset_task, 0); | 4023 | schedule_delayed_work(&bp->sp_rtnl_task, 0); |
4024 | /* Disable HW interrupts */ | 4024 | /* Disable HW interrupts */ |
4025 | bnx2x_int_disable(bp); | 4025 | bnx2x_int_disable(bp); |
4026 | /* In case of parity errors don't handle attentions so that | 4026 | /* In case of parity errors don't handle attentions so that |
@@ -7963,7 +7963,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
7963 | /* Wait until all other functions get | 7963 | /* Wait until all other functions get |
7964 | * down. | 7964 | * down. |
7965 | */ | 7965 | */ |
7966 | schedule_delayed_work(&bp->reset_task, | 7966 | schedule_delayed_work(&bp->sp_rtnl_task, |
7967 | HZ/10); | 7967 | HZ/10); |
7968 | return; | 7968 | return; |
7969 | } else { | 7969 | } else { |
@@ -8000,7 +8000,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8000 | break; | 8000 | break; |
8001 | } | 8001 | } |
8002 | 8002 | ||
8003 | schedule_delayed_work(&bp->reset_task, | 8003 | schedule_delayed_work(&bp->sp_rtnl_task, |
8004 | HZ/10); | 8004 | HZ/10); |
8005 | return; | 8005 | return; |
8006 | 8006 | ||
@@ -8011,7 +8011,8 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8011 | */ | 8011 | */ |
8012 | if (bnx2x_reset_is_global(bp)) { | 8012 | if (bnx2x_reset_is_global(bp)) { |
8013 | schedule_delayed_work( | 8013 | schedule_delayed_work( |
8014 | &bp->reset_task, HZ/10); | 8014 | &bp->sp_rtnl_task, |
8015 | HZ/10); | ||
8015 | return; | 8016 | return; |
8016 | } | 8017 | } |
8017 | 8018 | ||
@@ -8035,30 +8036,39 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8035 | /* bnx2x_nic_unload() flushes the bnx2x_wq, thus reset task is | 8036 | /* bnx2x_nic_unload() flushes the bnx2x_wq, thus reset task is |
8036 | * scheduled on a general queue in order to prevent a dead lock. | 8037 | * scheduled on a general queue in order to prevent a dead lock. |
8037 | */ | 8038 | */ |
8038 | static void bnx2x_reset_task(struct work_struct *work) | 8039 | static void bnx2x_sp_rtnl_task(struct work_struct *work) |
8039 | { | 8040 | { |
8040 | struct bnx2x *bp = container_of(work, struct bnx2x, reset_task.work); | 8041 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_rtnl_task.work); |
8041 | |||
8042 | #ifdef BNX2X_STOP_ON_ERROR | ||
8043 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" | ||
8044 | " so reset not done to allow debug dump,\n" | ||
8045 | KERN_ERR " you will need to reboot when done\n"); | ||
8046 | return; | ||
8047 | #endif | ||
8048 | 8042 | ||
8049 | rtnl_lock(); | 8043 | rtnl_lock(); |
8050 | 8044 | ||
8051 | if (!netif_running(bp->dev)) | 8045 | if (!netif_running(bp->dev)) |
8052 | goto reset_task_exit; | 8046 | goto sp_rtnl_exit; |
8047 | |||
8048 | /* if stop on error is defined no recovery flows should be executed */ | ||
8049 | #ifdef BNX2X_STOP_ON_ERROR | ||
8050 | BNX2X_ERR("recovery flow called but STOP_ON_ERROR defined " | ||
8051 | "so reset not done to allow debug dump,\n" | ||
8052 | "you will need to reboot when done\n"); | ||
8053 | goto sp_rtnl_exit; | ||
8054 | #endif | ||
8053 | 8055 | ||
8054 | if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) | 8056 | if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) { |
8057 | /* | ||
8058 | * Clear TX_TIMEOUT bit as we are going to reset the function | ||
8059 | * anyway. | ||
8060 | */ | ||
8061 | smp_mb__before_clear_bit(); | ||
8062 | clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state); | ||
8063 | smp_mb__after_clear_bit(); | ||
8055 | bnx2x_parity_recover(bp); | 8064 | bnx2x_parity_recover(bp); |
8056 | else { | 8065 | } else if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, |
8066 | &bp->sp_rtnl_state)){ | ||
8057 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 8067 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); |
8058 | bnx2x_nic_load(bp, LOAD_NORMAL); | 8068 | bnx2x_nic_load(bp, LOAD_NORMAL); |
8059 | } | 8069 | } |
8060 | 8070 | ||
8061 | reset_task_exit: | 8071 | sp_rtnl_exit: |
8062 | rtnl_unlock(); | 8072 | rtnl_unlock(); |
8063 | } | 8073 | } |
8064 | 8074 | ||
@@ -9291,7 +9301,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
9291 | #endif | 9301 | #endif |
9292 | 9302 | ||
9293 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); | 9303 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); |
9294 | INIT_DELAYED_WORK(&bp->reset_task, bnx2x_reset_task); | 9304 | INIT_DELAYED_WORK(&bp->sp_rtnl_task, bnx2x_sp_rtnl_task); |
9295 | INIT_DELAYED_WORK(&bp->period_task, bnx2x_period_task); | 9305 | INIT_DELAYED_WORK(&bp->period_task, bnx2x_period_task); |
9296 | rc = bnx2x_get_hwinfo(bp); | 9306 | rc = bnx2x_get_hwinfo(bp); |
9297 | if (rc) | 9307 | if (rc) |
@@ -10342,7 +10352,7 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) | |||
10342 | bnx2x_set_power_state(bp, PCI_D3hot); | 10352 | bnx2x_set_power_state(bp, PCI_D3hot); |
10343 | 10353 | ||
10344 | /* Make sure RESET task is not scheduled before continuing */ | 10354 | /* Make sure RESET task is not scheduled before continuing */ |
10345 | cancel_delayed_work_sync(&bp->reset_task); | 10355 | cancel_delayed_work_sync(&bp->sp_rtnl_task); |
10346 | 10356 | ||
10347 | if (bp->regview) | 10357 | if (bp->regview) |
10348 | iounmap(bp->regview); | 10358 | iounmap(bp->regview); |