Commit d58da590 authored by David Shaohua Li's avatar David Shaohua Li Committed by Len Brown

[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=3469Signed-off-by: default avatarDavid Shaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 362b06bb
...@@ -1927,6 +1927,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -1927,6 +1927,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
b44_free_rings(bp); b44_free_rings(bp);
spin_unlock_irq(&bp->lock); spin_unlock_irq(&bp->lock);
pci_disable_device(pdev);
return 0; return 0;
} }
...@@ -1936,6 +1937,8 @@ static int b44_resume(struct pci_dev *pdev) ...@@ -1936,6 +1937,8 @@ static int b44_resume(struct pci_dev *pdev)
struct b44 *bp = netdev_priv(dev); struct b44 *bp = netdev_priv(dev);
pci_restore_state(pdev); pci_restore_state(pdev);
pci_enable_device(pdev);
pci_set_master(pdev);
if (!netif_running(dev)) if (!netif_running(dev))
return 0; return 0;
......
...@@ -660,6 +660,7 @@ static int ne2k_pci_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -660,6 +660,7 @@ static int ne2k_pci_suspend (struct pci_dev *pdev, pm_message_t state)
netif_device_detach(dev); netif_device_detach(dev);
pci_save_state(pdev); pci_save_state(pdev);
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state)); pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0; return 0;
...@@ -671,6 +672,8 @@ static int ne2k_pci_resume (struct pci_dev *pdev) ...@@ -671,6 +672,8 @@ static int ne2k_pci_resume (struct pci_dev *pdev)
pci_set_power_state(pdev, 0); pci_set_power_state(pdev, 0);
pci_restore_state(pdev); pci_restore_state(pdev);
pci_enable_device(pdev);
pci_set_master(pdev);
NS8390_init(dev, 1); NS8390_init(dev, 1);
netif_device_attach(dev); netif_device_attach(dev);
......
...@@ -1032,6 +1032,7 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) ...@@ -1032,6 +1032,7 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
pci_save_state(dev); pci_save_state(dev);
pci_read_config_dword(dev, 16*4, &socket->saved_state[0]); pci_read_config_dword(dev, 16*4, &socket->saved_state[0]);
pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); pci_read_config_dword(dev, 17*4, &socket->saved_state[1]);
pci_disable_device(dev);
/* /*
* Some laptops (IBM T22) do not like us putting the Cardbus * 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,6 +1056,8 @@ static int yenta_dev_resume (struct pci_dev *dev)
pci_restore_state(dev); pci_restore_state(dev);
pci_write_config_dword(dev, 16*4, socket->saved_state[0]); pci_write_config_dword(dev, 16*4, socket->saved_state[0]);
pci_write_config_dword(dev, 17*4, socket->saved_state[1]); pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
pci_enable_device(dev);
pci_set_master(dev);
if (socket->type && socket->type->restore_state) if (socket->type && socket->type->restore_state)
socket->type->restore_state(socket); socket->type->restore_state(socket);
......
...@@ -380,6 +380,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev) ...@@ -380,6 +380,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
usb_hc_died (hcd); usb_hc_died (hcd);
} }
pci_enable_device(dev);
return retval; return retval;
} }
EXPORT_SYMBOL (usb_hcd_pci_resume); EXPORT_SYMBOL (usb_hcd_pci_resume);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment