aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2008-09-25 10:05:28 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-08 18:57:17 -0400
commit0ca41c0413a4d9ca58767d53d23accea9aa1cdef (patch)
treec94c8bc0ffbe971cddcb894df984c315b62f7fde /drivers
parent822f1a57d2ad957ae16b987115251539876aef26 (diff)
[2.6.28,1/1] cxgb3 - fix race in EEH
A SGE queue set timer might access registers while in EEH recovery, triggering an EEH error loop. Stop all timers early in EEH process. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cxgb3/adapter.h1
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c5
-rw-r--r--drivers/net/cxgb3/sge.c21
3 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 4f5cc6987ec1..e9da28597233 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -284,6 +284,7 @@ void t3_os_link_changed(struct adapter *adapter, int port_id, int link_status,
284 284
285void t3_sge_start(struct adapter *adap); 285void t3_sge_start(struct adapter *adap);
286void t3_sge_stop(struct adapter *adap); 286void t3_sge_stop(struct adapter *adap);
287void t3_stop_sge_timers(struct adapter *adap);
287void t3_free_sge_resources(struct adapter *adap); 288void t3_free_sge_resources(struct adapter *adap);
288void t3_sge_err_intr_handler(struct adapter *adapter); 289void t3_sge_err_intr_handler(struct adapter *adapter);
289irq_handler_t t3_intr_handler(struct adapter *adap, int polling); 290irq_handler_t t3_intr_handler(struct adapter *adap, int polling);
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 5447f3e60f07..d355c826b9b9 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -479,6 +479,7 @@ static int setup_sge_qsets(struct adapter *adap)
479 irq_idx, 479 irq_idx,
480 &adap->params.sge.qset[qset_idx], ntxq, dev); 480 &adap->params.sge.qset[qset_idx], ntxq, dev);
481 if (err) { 481 if (err) {
482 t3_stop_sge_timers(adap);
482 t3_free_sge_resources(adap); 483 t3_free_sge_resources(adap);
483 return err; 484 return err;
484 } 485 }
@@ -2449,6 +2450,9 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev,
2449 test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) 2450 test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map))
2450 offload_close(&adapter->tdev); 2451 offload_close(&adapter->tdev);
2451 2452
2453 /* Stop SGE timers */
2454 t3_stop_sge_timers(adapter);
2455
2452 adapter->flags &= ~FULL_INIT_DONE; 2456 adapter->flags &= ~FULL_INIT_DONE;
2453 2457
2454 pci_disable_device(pdev); 2458 pci_disable_device(pdev);
@@ -2801,6 +2805,7 @@ static void __devexit remove_one(struct pci_dev *pdev)
2801 if (test_bit(i, &adapter->registered_device_map)) 2805 if (test_bit(i, &adapter->registered_device_map))
2802 unregister_netdev(adapter->port[i]); 2806 unregister_netdev(adapter->port[i]);
2803 2807
2808 t3_stop_sge_timers(adapter);
2804 t3_free_sge_resources(adapter); 2809 t3_free_sge_resources(adapter);
2805 cxgb_disable_msi(adapter); 2810 cxgb_disable_msi(adapter);
2806 2811
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 89efd04be4e0..7346a8e26da1 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -603,9 +603,6 @@ static void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
603 int i; 603 int i;
604 struct pci_dev *pdev = adapter->pdev; 604 struct pci_dev *pdev = adapter->pdev;
605 605
606 if (q->tx_reclaim_timer.function)
607 del_timer_sync(&q->tx_reclaim_timer);
608
609 for (i = 0; i < SGE_RXQ_PER_SET; ++i) 606 for (i = 0; i < SGE_RXQ_PER_SET; ++i)
610 if (q->fl[i].desc) { 607 if (q->fl[i].desc) {
611 spin_lock_irq(&adapter->sge.reg_lock); 608 spin_lock_irq(&adapter->sge.reg_lock);
@@ -3009,6 +3006,24 @@ err:
3009} 3006}
3010 3007
3011/** 3008/**
3009 * t3_stop_sge_timers - stop SGE timer call backs
3010 * @adap: the adapter
3011 *
3012 * Stops each SGE queue set's timer call back
3013 */
3014void t3_stop_sge_timers(struct adapter *adap)
3015{
3016 int i;
3017
3018 for (i = 0; i < SGE_QSETS; ++i) {
3019 struct sge_qset *q = &adap->sge.qs[i];
3020
3021 if (q->tx_reclaim_timer.function)
3022 del_timer_sync(&q->tx_reclaim_timer);
3023 }
3024}
3025
3026/**
3012 * t3_free_sge_resources - free SGE resources 3027 * t3_free_sge_resources - free SGE resources
3013 * @adap: the adapter 3028 * @adap: the adapter
3014 * 3029 *