diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 992db89adce7..259d247b7551 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -309,17 +309,25 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
309 | 309 | ||
310 | pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); | 310 | pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); |
311 | 311 | ||
312 | /* If we're in D3, force entire word to 0. | 312 | /* If we're (effectively) in D3, force entire word to 0. |
313 | * This doesn't affect PME_Status, disables PME_En, and | 313 | * This doesn't affect PME_Status, disables PME_En, and |
314 | * sets PowerState to 0. | 314 | * sets PowerState to 0. |
315 | */ | 315 | */ |
316 | if (dev->current_state >= PCI_D3hot) { | 316 | switch (dev->current_state) { |
317 | if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) | 317 | case PCI_UNKNOWN: /* Boot-up */ |
318 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot | ||
319 | && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) | ||
318 | need_restore = 1; | 320 | need_restore = 1; |
321 | /* Fall-through: force to D0 */ | ||
322 | case PCI_D3hot: | ||
323 | case PCI_D3cold: | ||
324 | case PCI_POWER_ERROR: | ||
319 | pmcsr = 0; | 325 | pmcsr = 0; |
320 | } else { | 326 | break; |
327 | default: | ||
321 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | 328 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; |
322 | pmcsr |= state; | 329 | pmcsr |= state; |
330 | break; | ||
323 | } | 331 | } |
324 | 332 | ||
325 | /* enter specified state */ | 333 | /* enter specified state */ |