aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2013-08-08 16:10:02 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-08-14 17:24:41 -0400
commita6cbaadea0af9b4aa6eee2882f2aa761ab91a4f8 (patch)
tree15552cbb68ec0824681dfdd6a9bad5865b2e62e9 /drivers/pci
parent090a3c5322e900f468b3205b76d0837003ad57b2 (diff)
PCI: Wake-up devices before saving config space for reset
Devices come out of reset in D0. Restoring a device to a different post-reset state takes more smarts than our simple config space restore, which can leave devices in an inconsistent state. For example, if a device is reset in D3, but the restore doesn't successfully return the device to D3, then the actual state of the device and dev->current_state are contradictory. Put everything in D0 going into the reset, then we don't need to do anything special on the way out. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 12fccc24925c..deb7fa9cc638 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3332,6 +3332,13 @@ static void pci_dev_unlock(struct pci_dev *dev)
3332 3332
3333static void pci_dev_save_and_disable(struct pci_dev *dev) 3333static void pci_dev_save_and_disable(struct pci_dev *dev)
3334{ 3334{
3335 /*
3336 * Wake-up device prior to save. PM registers default to D0 after
3337 * reset and a simple register restore doesn't reliably return
3338 * to a non-D0 state anyway.
3339 */
3340 pci_set_power_state(dev, PCI_D0);
3341
3335 pci_save_state(dev); 3342 pci_save_state(dev);
3336 /* 3343 /*
3337 * Disable the device by clearing the Command register, except for 3344 * Disable the device by clearing the Command register, except for