diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2007-04-02 17:01:11 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-03 22:31:10 -0400 |
commit | 1371fa6db0bbb8e23f988a641f5ae7361bc629dd (patch) | |
tree | 650f90df889afd4bec688f8ffeffda02e8dedf16 /drivers | |
parent | 99f252b097a3bd6280047ba2175b605671da4a23 (diff) |
r8169: fix suspend/resume for down interface
The PM hooks are no-op if the r8169 interface is down (i.e. !IFF_UP).
However, as the chipset is enabled, the device will not work after a
suspend/resume cycle. The patch always issue the required PCI suspend
sequence and removes the module unload/reload workaround.
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/r8169.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 60f630e84bf0..6a77b8a92245 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2890,7 +2890,7 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2890 | void __iomem *ioaddr = tp->mmio_addr; | 2890 | void __iomem *ioaddr = tp->mmio_addr; |
2891 | 2891 | ||
2892 | if (!netif_running(dev)) | 2892 | if (!netif_running(dev)) |
2893 | goto out; | 2893 | goto out_pci_suspend; |
2894 | 2894 | ||
2895 | netif_device_detach(dev); | 2895 | netif_device_detach(dev); |
2896 | netif_stop_queue(dev); | 2896 | netif_stop_queue(dev); |
@@ -2904,10 +2904,11 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2904 | 2904 | ||
2905 | spin_unlock_irq(&tp->lock); | 2905 | spin_unlock_irq(&tp->lock); |
2906 | 2906 | ||
2907 | out_pci_suspend: | ||
2907 | pci_save_state(pdev); | 2908 | pci_save_state(pdev); |
2908 | pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled); | 2909 | pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled); |
2909 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 2910 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
2910 | out: | 2911 | |
2911 | return 0; | 2912 | return 0; |
2912 | } | 2913 | } |
2913 | 2914 | ||
@@ -2915,15 +2916,15 @@ static int rtl8169_resume(struct pci_dev *pdev) | |||
2915 | { | 2916 | { |
2916 | struct net_device *dev = pci_get_drvdata(pdev); | 2917 | struct net_device *dev = pci_get_drvdata(pdev); |
2917 | 2918 | ||
2919 | pci_set_power_state(pdev, PCI_D0); | ||
2920 | pci_restore_state(pdev); | ||
2921 | pci_enable_wake(pdev, PCI_D0, 0); | ||
2922 | |||
2918 | if (!netif_running(dev)) | 2923 | if (!netif_running(dev)) |
2919 | goto out; | 2924 | goto out; |
2920 | 2925 | ||
2921 | netif_device_attach(dev); | 2926 | netif_device_attach(dev); |
2922 | 2927 | ||
2923 | pci_set_power_state(pdev, PCI_D0); | ||
2924 | pci_restore_state(pdev); | ||
2925 | pci_enable_wake(pdev, PCI_D0, 0); | ||
2926 | |||
2927 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 2928 | rtl8169_schedule_work(dev, rtl8169_reset_task); |
2928 | out: | 2929 | out: |
2929 | return 0; | 2930 | return 0; |