diff options
author | David Shaohua Li <shaohua.li@intel.com> | 2005-03-18 16:43:54 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-11 23:23:46 -0400 |
commit | d58da590451cf6ae75379a2ebf96d3afb8d810d8 (patch) | |
tree | 3b39228dbd1ed798965cf64f5bd98a498f5811cc | |
parent | 362b06bb70b5a5779b2e852e0f2bdb437061106e (diff) |
[ACPI] S3 Suspend to RAM: fix driver suspend/resume methods
Drivers should do this:
.suspend()
pci_disable_device()
.resume()
pci_enable_device()
http://bugzilla.kernel.org/show_bug.cgi?id=3469
Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/net/b44.c | 3 | ||||
-rw-r--r-- | drivers/net/ne2k-pci.c | 3 | ||||
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 3fe8ba992c38..38844d003e44 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -1927,6 +1927,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1927 | b44_free_rings(bp); | 1927 | b44_free_rings(bp); |
1928 | 1928 | ||
1929 | spin_unlock_irq(&bp->lock); | 1929 | spin_unlock_irq(&bp->lock); |
1930 | pci_disable_device(pdev); | ||
1930 | return 0; | 1931 | return 0; |
1931 | } | 1932 | } |
1932 | 1933 | ||
@@ -1936,6 +1937,8 @@ static int b44_resume(struct pci_dev *pdev) | |||
1936 | struct b44 *bp = netdev_priv(dev); | 1937 | struct b44 *bp = netdev_priv(dev); |
1937 | 1938 | ||
1938 | pci_restore_state(pdev); | 1939 | pci_restore_state(pdev); |
1940 | pci_enable_device(pdev); | ||
1941 | pci_set_master(pdev); | ||
1939 | 1942 | ||
1940 | if (!netif_running(dev)) | 1943 | if (!netif_running(dev)) |
1941 | return 0; | 1944 | return 0; |
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index a1a6c08e7dcf..f1c01ac29102 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -660,6 +660,7 @@ static int ne2k_pci_suspend (struct pci_dev *pdev, pm_message_t state) | |||
660 | 660 | ||
661 | netif_device_detach(dev); | 661 | netif_device_detach(dev); |
662 | pci_save_state(pdev); | 662 | pci_save_state(pdev); |
663 | pci_disable_device(pdev); | ||
663 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 664 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
664 | 665 | ||
665 | return 0; | 666 | return 0; |
@@ -671,6 +672,8 @@ static int ne2k_pci_resume (struct pci_dev *pdev) | |||
671 | 672 | ||
672 | pci_set_power_state(pdev, 0); | 673 | pci_set_power_state(pdev, 0); |
673 | pci_restore_state(pdev); | 674 | pci_restore_state(pdev); |
675 | pci_enable_device(pdev); | ||
676 | pci_set_master(pdev); | ||
674 | NS8390_init(dev, 1); | 677 | NS8390_init(dev, 1); |
675 | netif_device_attach(dev); | 678 | netif_device_attach(dev); |
676 | 679 | ||
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 6404d97a12eb..caf7159a54be 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -1032,6 +1032,7 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) | |||
1032 | pci_save_state(dev); | 1032 | pci_save_state(dev); |
1033 | pci_read_config_dword(dev, 16*4, &socket->saved_state[0]); | 1033 | pci_read_config_dword(dev, 16*4, &socket->saved_state[0]); |
1034 | pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); | 1034 | pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); |
1035 | pci_disable_device(dev); | ||
1035 | 1036 | ||
1036 | /* | 1037 | /* |
1037 | * Some laptops (IBM T22) do not like us putting the Cardbus | 1038 | * Some laptops (IBM T22) do not like us putting the Cardbus |
@@ -1055,6 +1056,8 @@ static int yenta_dev_resume (struct pci_dev *dev) | |||
1055 | pci_restore_state(dev); | 1056 | pci_restore_state(dev); |
1056 | pci_write_config_dword(dev, 16*4, socket->saved_state[0]); | 1057 | pci_write_config_dword(dev, 16*4, socket->saved_state[0]); |
1057 | pci_write_config_dword(dev, 17*4, socket->saved_state[1]); | 1058 | pci_write_config_dword(dev, 17*4, socket->saved_state[1]); |
1059 | pci_enable_device(dev); | ||
1060 | pci_set_master(dev); | ||
1058 | 1061 | ||
1059 | if (socket->type && socket->type->restore_state) | 1062 | if (socket->type && socket->type->restore_state) |
1060 | socket->type->restore_state(socket); | 1063 | socket->type->restore_state(socket); |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 71b4a8d66318..fc056062c960 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -380,6 +380,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev) | |||
380 | usb_hc_died (hcd); | 380 | usb_hc_died (hcd); |
381 | } | 381 | } |
382 | 382 | ||
383 | pci_enable_device(dev); | ||
383 | return retval; | 384 | return retval; |
384 | } | 385 | } |
385 | EXPORT_SYMBOL (usb_hcd_pci_resume); | 386 | EXPORT_SYMBOL (usb_hcd_pci_resume); |