summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-10-29 17:26:54 -0600
committerBjorn Helgaas <bhelgaas@google.com>2012-11-07 15:24:18 -0700
commit42eca2302146fed51335b95128e949ee6f54478f (patch)
tree3008a3fd2494e79e2f98bf6cd304c2b8e2f8ceac /drivers/pci
parent8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff)
downloadblackbird-op-linux-42eca2302146fed51335b95128e949ee6f54478f.tar.gz
blackbird-op-linux-42eca2302146fed51335b95128e949ee6f54478f.zip
PCI: Don't touch card regs after runtime suspend D3
If the driver takes care of state saving, don't touch any registers on it. Optimus (dual-gpu) laptops seem to have their own form of D3cold, but unfortunately enter it on normal D3 transitions via the ACPI callback. So when we use runtime PM to transition to D3, the card disappears off the PCI bus, however we then try to access registers on it in the runtime suspend finish, which really doesn't work. This patch checks whether the pci state is saved and doesn't attempt to hit any registers after that point if it is. (Looks okay to Rafael) Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 94c6e2aa03d6..11d9c8a9d0d0 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1023,10 +1023,10 @@ static int pci_pm_runtime_suspend(struct device *dev)
return 0;
}
- if (!pci_dev->state_saved)
+ if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
-
- pci_finish_runtime_suspend(pci_dev);
+ pci_finish_runtime_suspend(pci_dev);
+ }
return 0;
}
OpenPOWER on IntegriCloud