aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-04 06:56:05 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-02-11 19:40:27 -0500
commit82fee4d67ab86d6fe5eb0f9a9e988ca9d654d765 (patch)
treed72305b7abc833c3d33c29402d7548e7acbe03c6 /drivers/pci/pci-driver.c
parentcc7ba39bab126339d6d525ada07dea5633d71521 (diff)
PCI/PM: Clear state_saved during suspend
This patch clears pci_dev->state_saved at the beginning of suspending. PCI config state may be saved long before that. Some drivers call pci_save_state() from the ->probe() callback to get snapshot of sane configuration space to use in the ->slot_reset() callback. Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> # add comment Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index dc5bdce63f12..f9aa311b9f34 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -628,6 +628,7 @@ static int pci_pm_suspend(struct device *dev)
628 goto Fixup; 628 goto Fixup;
629 } 629 }
630 630
631 pci_dev->state_saved = false;
631 if (pm->suspend) { 632 if (pm->suspend) {
632 pci_power_t prev = pci_dev->current_state; 633 pci_power_t prev = pci_dev->current_state;
633 int error; 634 int error;
@@ -774,6 +775,7 @@ static int pci_pm_freeze(struct device *dev)
774 return 0; 775 return 0;
775 } 776 }
776 777
778 pci_dev->state_saved = false;
777 if (pm->freeze) { 779 if (pm->freeze) {
778 int error; 780 int error;
779 781
@@ -862,6 +864,7 @@ static int pci_pm_poweroff(struct device *dev)
862 goto Fixup; 864 goto Fixup;
863 } 865 }
864 866
867 pci_dev->state_saved = false;
865 if (pm->poweroff) { 868 if (pm->poweroff) {
866 int error; 869 int error;
867 870
@@ -987,6 +990,7 @@ static int pci_pm_runtime_suspend(struct device *dev)
987 if (!pm || !pm->runtime_suspend) 990 if (!pm || !pm->runtime_suspend)
988 return -ENOSYS; 991 return -ENOSYS;
989 992
993 pci_dev->state_saved = false;
990 pci_dev->no_d3cold = false; 994 pci_dev->no_d3cold = false;
991 error = pm->runtime_suspend(dev); 995 error = pm->runtime_suspend(dev);
992 suspend_report_result(pm->runtime_suspend, error); 996 suspend_report_result(pm->runtime_suspend, error);