aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-09 14:58:11 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-09 14:58:11 +0100
commit249d51b53aea1b7cdb1be65a1a9a0c59d9e06f3e (patch)
tree7fc06930e46ee13d394f5b031166c40206af3189 /drivers/pci/pci.c
parent44581a28e805a31661469c4b466b9cd14b36e7b6 (diff)
parent8e4921515c1a379539607eb443d51c30f4f7f338 (diff)
Merge commit 'v2.6.29-rc4' into core/percpu
Conflicts: arch/x86/mach-voyager/voyager_smp.c arch/x86/mm/fault.c
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 17bd9325a24..e3efe6b19ee 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1393,35 +1393,35 @@ int pci_restore_standard_config(struct pci_dev *dev)
pci_power_t prev_state;
int error;
- pci_restore_state(dev);
pci_update_current_state(dev, PCI_D0);
prev_state = dev->current_state;
if (prev_state == PCI_D0)
- return 0;
+ goto Restore;
error = pci_raw_set_power_state(dev, PCI_D0, false);
if (error)
return error;
- if (pci_is_bridge(dev)) {
- if (prev_state > PCI_D1)
- mdelay(PCI_PM_BUS_WAIT);
- } else {
- switch(prev_state) {
- case PCI_D3cold:
- case PCI_D3hot:
- mdelay(pci_pm_d3_delay);
- break;
- case PCI_D2:
- udelay(PCI_PM_D2_DELAY);
- break;
- }
+ /*
+ * This assumes that we won't get a bus in B2 or B3 from the BIOS, but
+ * we've made this assumption forever and it appears to be universally
+ * satisfied.
+ */
+ switch(prev_state) {
+ case PCI_D3cold:
+ case PCI_D3hot:
+ mdelay(pci_pm_d3_delay);
+ break;
+ case PCI_D2:
+ udelay(PCI_PM_D2_DELAY);
+ break;
}
- dev->current_state = PCI_D0;
+ pci_update_current_state(dev, PCI_D0);
- return 0;
+ Restore:
+ return dev->state_saved ? pci_restore_state(dev) : 0;
}
/**