]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] e1000: Fix regression: garbled stats and irq allocation during swsusp
authorAuke Kok <auke-jan.h.kok@intel.com>
Mon, 6 Nov 2006 16:57:12 +0000 (08:57 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 7 Nov 2006 09:27:51 +0000 (04:27 -0500)
e1000: Fix suspend/resume powerup and irq allocation

From: Auke Kok <auke-jan.h.kok@intel.com>

After 7.0.33/2.6.16, e1000 suspend/resume left the user with an enabled
device showing garbled statistics and undetermined irq allocation state,
where `ifconfig eth0 down` would display `trying to free already freed irq`.

Explicitly free and allocate irq as well as powerup the PHY during resume
fixes when needed.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/e1000/e1000_main.c

index 8d04752777a83e93a0441399a685b6b2656ead3e..726ec5e88ab2e414fde9624ce60b011c5668757c 100644 (file)
@@ -4800,6 +4800,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
        if (adapter->hw.phy_type == e1000_phy_igp_3)
                e1000_phy_powerdown_workaround(&adapter->hw);
 
+       if (netif_running(netdev))
+               e1000_free_irq(adapter);
+
        /* Release control of h/w to f/w.  If f/w is AMT enabled, this
         * would have already happened in close and is redundant. */
        e1000_release_hw_control(adapter);
@@ -4830,6 +4833,10 @@ e1000_resume(struct pci_dev *pdev)
        pci_enable_wake(pdev, PCI_D3hot, 0);
        pci_enable_wake(pdev, PCI_D3cold, 0);
 
+       if (netif_running(netdev) && (err = e1000_request_irq(adapter)))
+               return err;
+
+       e1000_power_up_phy(adapter);
        e1000_reset(adapter);
        E1000_WRITE_REG(&adapter->hw, WUS, ~0);