aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2008-05-06 22:25:56 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-13 01:31:37 -0400
commit48c4b6dbb7e246957e13302668acf7c77e4f8b3a (patch)
treed371d94d8f90d880e5d8c5e3dd50ffaa607d0676
parent014377a1df693ff30a9e8b69f0bbb0a38e601f75 (diff)
cxgb3 - fix port up/down error path
Fix faiures path when ports are stopped and restarted in EEH recovery. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/net/cxgb3/adapter.h1
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c32
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 4fdb13f8447b..acebe431d068 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -71,6 +71,7 @@ enum { /* adapter flags */
71 USING_MSIX = (1 << 2), 71 USING_MSIX = (1 << 2),
72 QUEUES_BOUND = (1 << 3), 72 QUEUES_BOUND = (1 << 3),
73 TP_PARITY_INIT = (1 << 4), 73 TP_PARITY_INIT = (1 << 4),
74 NAPI_INIT = (1 << 5),
74}; 75};
75 76
76struct fl_pg_chunk { 77struct fl_pg_chunk {
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index ce949d5fae39..d67fc10a6b36 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -421,6 +421,13 @@ static void init_napi(struct adapter *adap)
421 netif_napi_add(qs->netdev, &qs->napi, qs->napi.poll, 421 netif_napi_add(qs->netdev, &qs->napi, qs->napi.poll,
422 64); 422 64);
423 } 423 }
424
425 /*
426 * netif_napi_add() can be called only once per napi_struct because it
427 * adds each new napi_struct to a list. Be careful not to call it a
428 * second time, e.g., during EEH recovery, by making a note of it.
429 */
430 adap->flags |= NAPI_INIT;
424} 431}
425 432
426/* 433/*
@@ -896,7 +903,8 @@ static int cxgb_up(struct adapter *adap)
896 goto out; 903 goto out;
897 904
898 setup_rss(adap); 905 setup_rss(adap);
899 init_napi(adap); 906 if (!(adap->flags & NAPI_INIT))
907 init_napi(adap);
900 adap->flags |= FULL_INIT_DONE; 908 adap->flags |= FULL_INIT_DONE;
901 } 909 }
902 910
@@ -999,7 +1007,7 @@ static int offload_open(struct net_device *dev)
999 return 0; 1007 return 0;
1000 1008
1001 if (!adap_up && (err = cxgb_up(adapter)) < 0) 1009 if (!adap_up && (err = cxgb_up(adapter)) < 0)
1002 return err; 1010 goto out;
1003 1011
1004 t3_tp_set_offload_mode(adapter, 1); 1012 t3_tp_set_offload_mode(adapter, 1);
1005 tdev->lldev = adapter->port[0]; 1013 tdev->lldev = adapter->port[0];
@@ -1061,10 +1069,8 @@ static int cxgb_open(struct net_device *dev)
1061 int other_ports = adapter->open_device_map & PORT_MASK; 1069 int other_ports = adapter->open_device_map & PORT_MASK;
1062 int err; 1070 int err;
1063 1071
1064 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0) { 1072 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0)
1065 quiesce_rx(adapter);
1066 return err; 1073 return err;
1067 }
1068 1074
1069 set_bit(pi->port_id, &adapter->open_device_map); 1075 set_bit(pi->port_id, &adapter->open_device_map);
1070 if (is_offload(adapter) && !ofld_disable) { 1076 if (is_offload(adapter) && !ofld_disable) {
@@ -2431,7 +2437,7 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev,
2431 2437
2432 pci_disable_device(pdev); 2438 pci_disable_device(pdev);
2433 2439
2434 /* Request a slot slot reset. */ 2440 /* Request a slot reset. */
2435 return PCI_ERS_RESULT_NEED_RESET; 2441 return PCI_ERS_RESULT_NEED_RESET;
2436} 2442}
2437 2443
@@ -2448,13 +2454,16 @@ static pci_ers_result_t t3_io_slot_reset(struct pci_dev *pdev)
2448 if (pci_enable_device(pdev)) { 2454 if (pci_enable_device(pdev)) {
2449 dev_err(&pdev->dev, 2455 dev_err(&pdev->dev,
2450 "Cannot re-enable PCI device after reset.\n"); 2456 "Cannot re-enable PCI device after reset.\n");
2451 return PCI_ERS_RESULT_DISCONNECT; 2457 goto err;
2452 } 2458 }
2453 pci_set_master(pdev); 2459 pci_set_master(pdev);
2454 2460
2455 t3_prep_adapter(adapter, adapter->params.info, 1); 2461 if (t3_prep_adapter(adapter, adapter->params.info, 1))
2462 goto err;
2456 2463
2457 return PCI_ERS_RESULT_RECOVERED; 2464 return PCI_ERS_RESULT_RECOVERED;
2465err:
2466 return PCI_ERS_RESULT_DISCONNECT;
2458} 2467}
2459 2468
2460/** 2469/**
@@ -2483,13 +2492,6 @@ static void t3_io_resume(struct pci_dev *pdev)
2483 netif_device_attach(netdev); 2492 netif_device_attach(netdev);
2484 } 2493 }
2485 } 2494 }
2486
2487 if (is_offload(adapter)) {
2488 __set_bit(OFFLOAD_DEVMAP_BIT, &adapter->registered_device_map);
2489 if (offload_open(adapter->port[0]))
2490 printk(KERN_WARNING
2491 "Could not bring back offload capabilities\n");
2492 }
2493} 2495}
2494 2496
2495static struct pci_error_handlers t3_err_handler = { 2497static struct pci_error_handlers t3_err_handler = {