Skip to content

Commit

Permalink
libata: disable pdev on all suspend events
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 21, 2007
1 parent 5e5c74a commit 4c90d97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4c90d97

Please sign in to comment.