summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo2007-02-20 10:14:48 +0100
committerJeff Garzik2007-02-21 10:58:18 +0100
commit4c90d9717ae27dddf4b02ed7d683e502b539cd1c (patch)
tree5f089e1292536a84d7a8738ed276501c0600eaad /drivers/ata/libata-core.c
parentsata_nv: delay on switching between NCQ and non-NCQ commands (diff)
downloadkernel-qcow2-linux-4c90d9717ae27dddf4b02ed7d683e502b539cd1c.tar.gz
kernel-qcow2-linux-4c90d9717ae27dddf4b02ed7d683e502b539cd1c.tar.xz
kernel-qcow2-linux-4c90d9717ae27dddf4b02ed7d683e502b539cd1c.zip
libata: disable pdev on all suspend events
libata used disable pdev only on PM_EVENT_SUSPEND while re-enable pdev unconditionally. This was okay before ref-counted pdev enable update but it now makes the pdev pinned after swsusp cycle (enabled twice but disabled only once) and devres sanity check whines about it. Fix it by unconditionally disabling pdev on all suspend events. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 794f327e398a..b71a7ef3f92a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6054,11 +6054,10 @@ int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits)
void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
pci_save_state(pdev);
+ pci_disable_device(pdev);
- if (mesg.event == PM_EVENT_SUSPEND) {
- pci_disable_device(pdev);
+ if (mesg.event == PM_EVENT_SUSPEND)
pci_set_power_state(pdev, PCI_D3hot);
- }
}
int ata_pci_device_do_resume(struct pci_dev *pdev)