diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-02 22:28:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-02 22:28:58 -0500 |
commit | b1792e367053968f2ddb48bc911d314143ce6242 (patch) | |
tree | 31ac3fddb0b14a202e9ceaa9681c1335ba35210c /drivers/pci/pci-driver.c | |
parent | 859281ff370977f917ec2195f86a5bfccf1fc6d6 (diff) | |
parent | 71a082efc9fdc12068a3cee6cebb1330b00ebeee (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
PCI hotplug: Change link order of pciehp & acpiphp
PCI hotplug: fakephp: Allocate PCI resources before adding the device
PCI MSI: Fix undefined shift by 32
PCI PM: Do not wait for buses in B2 or B3 during resume
PCI PM: Power up devices before restoring their state
PCI PM: Fix hibernation breakage on EeePC 701
PCI: irq and pci_ids patch for Intel Tigerpoint DeviceIDs
PCI PM: Fix suspend error paths and testing facility breakage
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 9de07b75b993..ab1d615425a8 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -370,6 +370,7 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state) | |||
370 | } | 370 | } |
371 | 371 | ||
372 | pci_save_state(pci_dev); | 372 | pci_save_state(pci_dev); |
373 | pci_dev->state_saved = true; | ||
373 | /* | 374 | /* |
374 | * This is for compatibility with existing code with legacy PM support. | 375 | * This is for compatibility with existing code with legacy PM support. |
375 | */ | 376 | */ |
@@ -419,6 +420,7 @@ static int pci_legacy_resume(struct device *dev) | |||
419 | static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev) | 420 | static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev) |
420 | { | 421 | { |
421 | pci_restore_standard_config(pci_dev); | 422 | pci_restore_standard_config(pci_dev); |
423 | pci_dev->state_saved = false; | ||
422 | pci_fixup_device(pci_fixup_resume_early, pci_dev); | 424 | pci_fixup_device(pci_fixup_resume_early, pci_dev); |
423 | } | 425 | } |
424 | 426 | ||
@@ -555,6 +557,13 @@ static int pci_pm_resume(struct device *dev) | |||
555 | struct device_driver *drv = dev->driver; | 557 | struct device_driver *drv = dev->driver; |
556 | int error = 0; | 558 | int error = 0; |
557 | 559 | ||
560 | /* | ||
561 | * This is necessary for the suspend error path in which resume is | ||
562 | * called without restoring the standard config registers of the device. | ||
563 | */ | ||
564 | if (pci_dev->state_saved) | ||
565 | pci_restore_standard_config(pci_dev); | ||
566 | |||
558 | if (pci_has_legacy_pm_support(pci_dev)) | 567 | if (pci_has_legacy_pm_support(pci_dev)) |
559 | return pci_legacy_resume(dev); | 568 | return pci_legacy_resume(dev); |
560 | 569 | ||
@@ -660,7 +669,10 @@ static int pci_pm_poweroff(struct device *dev) | |||
660 | if (pci_has_legacy_pm_support(pci_dev)) | 669 | if (pci_has_legacy_pm_support(pci_dev)) |
661 | return pci_legacy_suspend(dev, PMSG_HIBERNATE); | 670 | return pci_legacy_suspend(dev, PMSG_HIBERNATE); |
662 | 671 | ||
663 | if (drv && drv->pm && drv->pm->poweroff) { | 672 | if (!drv || !drv->pm) |
673 | return 0; | ||
674 | |||
675 | if (drv->pm->poweroff) { | ||
664 | error = drv->pm->poweroff(dev); | 676 | error = drv->pm->poweroff(dev); |
665 | suspend_report_result(drv->pm->poweroff, error); | 677 | suspend_report_result(drv->pm->poweroff, error); |
666 | } | 678 | } |
@@ -710,6 +722,13 @@ static int pci_pm_restore(struct device *dev) | |||
710 | struct device_driver *drv = dev->driver; | 722 | struct device_driver *drv = dev->driver; |
711 | int error = 0; | 723 | int error = 0; |
712 | 724 | ||
725 | /* | ||
726 | * This is necessary for the hibernation error path in which restore is | ||
727 | * called without restoring the standard config registers of the device. | ||
728 | */ | ||
729 | if (pci_dev->state_saved) | ||
730 | pci_restore_standard_config(pci_dev); | ||
731 | |||
713 | if (pci_has_legacy_pm_support(pci_dev)) | 732 | if (pci_has_legacy_pm_support(pci_dev)) |
714 | return pci_legacy_resume(dev); | 733 | return pci_legacy_resume(dev); |
715 | 734 | ||