aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 94ac168be593..28540265240c 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2641,6 +2641,10 @@ static void myri10ge_watchdog(struct work_struct *work)
2641 * nic was resumed from power saving mode. 2641 * nic was resumed from power saving mode.
2642 */ 2642 */
2643 myri10ge_restore_state(mgp); 2643 myri10ge_restore_state(mgp);
2644
2645 /* save state again for accounting reasons */
2646 myri10ge_save_state(mgp);
2647
2644 } else { 2648 } else {
2645 /* if we get back -1's from our slot, perhaps somebody 2649 /* if we get back -1's from our slot, perhaps somebody
2646 * powered off our card. Don't try to reset it in 2650 * powered off our card. Don't try to reset it in
@@ -2907,7 +2911,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2907 status = register_netdev(netdev); 2911 status = register_netdev(netdev);
2908 if (status != 0) { 2912 if (status != 0) {
2909 dev_err(&pdev->dev, "register_netdev failed: %d\n", status); 2913 dev_err(&pdev->dev, "register_netdev failed: %d\n", status);
2910 goto abort_with_irq; 2914 goto abort_with_state;
2911 } 2915 }
2912 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2916 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
2913 (mgp->msi_enabled ? "MSI" : "xPIC"), 2917 (mgp->msi_enabled ? "MSI" : "xPIC"),
@@ -2916,7 +2920,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2916 2920
2917 return 0; 2921 return 0;
2918 2922
2919abort_with_irq: 2923abort_with_state:
2924 myri10ge_restore_state(mgp);
2920 free_irq(pdev->irq, mgp); 2925 free_irq(pdev->irq, mgp);
2921 if (mgp->msi_enabled) 2926 if (mgp->msi_enabled)
2922 pci_disable_msi(pdev); 2927 pci_disable_msi(pdev);
@@ -2976,6 +2981,9 @@ static void myri10ge_remove(struct pci_dev *pdev)
2976 2981
2977 myri10ge_dummy_rdma(mgp, 0); 2982 myri10ge_dummy_rdma(mgp, 0);
2978 2983
2984 /* avoid a memory leak */
2985 myri10ge_restore_state(mgp);
2986
2979 bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); 2987 bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry);
2980 dma_free_coherent(&pdev->dev, bytes, 2988 dma_free_coherent(&pdev->dev, bytes,
2981 mgp->rx_done.entry, mgp->rx_done.bus); 2989 mgp->rx_done.entry, mgp->rx_done.bus);