aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-09-09 17:49:59 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-14 16:41:46 -0400
commit4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff (patch)
tree957f38dc1065e2880197e7ca5ffe1592515010b3 /drivers/pci/pci.c
parent999cce4a52d5abdda5d2cec6bac241899bc19e4c (diff)
PCI: Clear saved_state after the state has been restored
Some PCI devices fail if their standard configuration registers are restored twice in a row. Prevent this from happening by making pci_restore_state() clear the saved_state flag of the device right after the device's standard configuration registers have been populated with the previously saved values. Simplify PCI PM callbacks by removing the direct clearing of state_saved from them, as it shouldn't be necessary any more (except in pci_pm_thaw(), where it has to be cleared, so that the values saved during the "freeze" phase of hibernation are not used later by mistake). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index dcdfb2212ca3..6edecff0b419 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -854,6 +854,7 @@ pci_restore_state(struct pci_dev *dev)
854 854
855 if (!dev->state_saved) 855 if (!dev->state_saved)
856 return 0; 856 return 0;
857
857 /* PCI Express register must be restored first */ 858 /* PCI Express register must be restored first */
858 pci_restore_pcie_state(dev); 859 pci_restore_pcie_state(dev);
859 860
@@ -875,6 +876,8 @@ pci_restore_state(struct pci_dev *dev)
875 pci_restore_msi_state(dev); 876 pci_restore_msi_state(dev);
876 pci_restore_iov_state(dev); 877 pci_restore_iov_state(dev);
877 878
879 dev->state_saved = false;
880
878 return 0; 881 return 0;
879} 882}
880 883