diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-05-15 15:51:31 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-06-10 13:59:46 -0400 |
commit | e1a2a51e684bfe9d6165992d4a065439617a3107 (patch) | |
tree | 4d05a1b9ebadd0ab22e0e42ee3b053dddf11baf1 /drivers/pci/pci-driver.c | |
parent | 273c11270d3715c4c06d4df1607a1a60034d887b (diff) |
Suspend/Resume bug in PCI layer wrt quirks
Some quirks should be called with interrupt disabled, we can't directly
call them in .resume_early. Also the patch introduces
pci_fixup_resume_early and pci_fixup_suspend, which matches current
device core callbacks (.suspend/.resume_early).
TBD: Somebody knows why we need quirk resume should double check if a
quirk should be called in resume or resume_early. I changed some per my
understanding, but can't make sure I fixed all.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 72cf61ed8f96..677fd9d6db12 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -292,6 +292,9 @@ static int pci_device_suspend(struct device * dev, pm_message_t state) | |||
292 | if (pci_dev->current_state == PCI_D0) | 292 | if (pci_dev->current_state == PCI_D0) |
293 | pci_dev->current_state = PCI_UNKNOWN; | 293 | pci_dev->current_state = PCI_UNKNOWN; |
294 | } | 294 | } |
295 | |||
296 | pci_fixup_device(pci_fixup_suspend, pci_dev); | ||
297 | |||
295 | return i; | 298 | return i; |
296 | } | 299 | } |
297 | 300 | ||
@@ -337,6 +340,7 @@ static int pci_device_resume(struct device * dev) | |||
337 | error = drv->resume(pci_dev); | 340 | error = drv->resume(pci_dev); |
338 | else | 341 | else |
339 | error = pci_default_resume(pci_dev); | 342 | error = pci_default_resume(pci_dev); |
343 | pci_fixup_device(pci_fixup_resume, pci_dev); | ||
340 | return error; | 344 | return error; |
341 | } | 345 | } |
342 | 346 | ||
@@ -346,7 +350,7 @@ static int pci_device_resume_early(struct device * dev) | |||
346 | struct pci_dev * pci_dev = to_pci_dev(dev); | 350 | struct pci_dev * pci_dev = to_pci_dev(dev); |
347 | struct pci_driver * drv = pci_dev->driver; | 351 | struct pci_driver * drv = pci_dev->driver; |
348 | 352 | ||
349 | pci_fixup_device(pci_fixup_resume, pci_dev); | 353 | pci_fixup_device(pci_fixup_resume_early, pci_dev); |
350 | 354 | ||
351 | if (drv && drv->resume_early) | 355 | if (drv && drv->resume_early) |
352 | error = drv->resume_early(pci_dev); | 356 | error = drv->resume_early(pci_dev); |