Skip to content

Commit 42eca23

Browse files
airliedbjorn-helgaas
authored andcommitted
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 <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 8f0d816 commit 42eca23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pci/pci-driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,10 +1023,10 @@ static int pci_pm_runtime_suspend(struct device *dev)
10231023
return 0;
10241024
}
10251025

1026-
if (!pci_dev->state_saved)
1026+
if (!pci_dev->state_saved) {
10271027
pci_save_state(pci_dev);
1028-
1029-
pci_finish_runtime_suspend(pci_dev);
1028+
pci_finish_runtime_suspend(pci_dev);
1029+
}
10301030

10311031
return 0;
10321032
}

0 commit comments

Comments
 (0)