diff options
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index ce949d5fae39..3a3127216791 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) { |
@@ -2424,14 +2430,11 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev, | |||
2424 | test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) | 2430 | test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) |
2425 | offload_close(&adapter->tdev); | 2431 | offload_close(&adapter->tdev); |
2426 | 2432 | ||
2427 | /* Free sge resources */ | ||
2428 | t3_free_sge_resources(adapter); | ||
2429 | |||
2430 | adapter->flags &= ~FULL_INIT_DONE; | 2433 | adapter->flags &= ~FULL_INIT_DONE; |
2431 | 2434 | ||
2432 | pci_disable_device(pdev); | 2435 | pci_disable_device(pdev); |
2433 | 2436 | ||
2434 | /* Request a slot slot reset. */ | 2437 | /* Request a slot reset. */ |
2435 | return PCI_ERS_RESULT_NEED_RESET; | 2438 | return PCI_ERS_RESULT_NEED_RESET; |
2436 | } | 2439 | } |
2437 | 2440 | ||
@@ -2448,13 +2451,20 @@ static pci_ers_result_t t3_io_slot_reset(struct pci_dev *pdev) | |||
2448 | if (pci_enable_device(pdev)) { | 2451 | if (pci_enable_device(pdev)) { |
2449 | dev_err(&pdev->dev, | 2452 | dev_err(&pdev->dev, |
2450 | "Cannot re-enable PCI device after reset.\n"); | 2453 | "Cannot re-enable PCI device after reset.\n"); |
2451 | return PCI_ERS_RESULT_DISCONNECT; | 2454 | goto err; |
2452 | } | 2455 | } |
2453 | pci_set_master(pdev); | 2456 | pci_set_master(pdev); |
2457 | pci_restore_state(pdev); | ||
2454 | 2458 | ||
2455 | t3_prep_adapter(adapter, adapter->params.info, 1); | 2459 | /* Free sge resources */ |
2460 | t3_free_sge_resources(adapter); | ||
2461 | |||
2462 | if (t3_replay_prep_adapter(adapter)) | ||
2463 | goto err; | ||
2456 | 2464 | ||
2457 | return PCI_ERS_RESULT_RECOVERED; | 2465 | return PCI_ERS_RESULT_RECOVERED; |
2466 | err: | ||
2467 | return PCI_ERS_RESULT_DISCONNECT; | ||
2458 | } | 2468 | } |
2459 | 2469 | ||
2460 | /** | 2470 | /** |
@@ -2483,13 +2493,6 @@ static void t3_io_resume(struct pci_dev *pdev) | |||
2483 | netif_device_attach(netdev); | 2493 | netif_device_attach(netdev); |
2484 | } | 2494 | } |
2485 | } | 2495 | } |
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 | } | 2496 | } |
2494 | 2497 | ||
2495 | static struct pci_error_handlers t3_err_handler = { | 2498 | static struct pci_error_handlers t3_err_handler = { |
@@ -2608,6 +2611,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2608 | } | 2611 | } |
2609 | 2612 | ||
2610 | pci_set_master(pdev); | 2613 | pci_set_master(pdev); |
2614 | pci_save_state(pdev); | ||
2611 | 2615 | ||
2612 | mmio_start = pci_resource_start(pdev, 0); | 2616 | mmio_start = pci_resource_start(pdev, 0); |
2613 | mmio_len = pci_resource_len(pdev, 0); | 2617 | mmio_len = pci_resource_len(pdev, 0); |