aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-05-18 16:51:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-11 15:04:20 -0400
commitf62795f1e892ca9269849fa83de97621da7e02c0 (patch)
treecfa28abc0ec45270045e7fd0e852efd1e3e319a3 /drivers/pci/pci.c
parent4d135dbee7b0a89e946f7ba284f2b957505a2c3a (diff)
PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3
According to the PCI PM specification (PCI Bus Power Management Interface Specification, Rev. 1.2, Section 5.4.1) we are supposed to reinitialize devices that have PCI_PM_CTRL_NO_SOFT_RESET clear during all transitions from PCI_D3hot to PCI_D0, but we only do it if the device's current_state field is equal to PCI_UNKNOWN. This may lead to problems if a device with PCI_PM_CTRL_NO_SOFT_RESET unset is put into PCI_D3hot at run time by its driver and pci_set_power_state() is used to put it back into PCI_D0, because in that case the device will remain uninitialized after pci_set_power_state() has returned. Prevent that from happening by modifying pci_raw_set_power_state() to reinitialize devices with PCI_PM_CTRL_NO_SOFT_RESET unset during all transitions from D3 to D0. Cc: stable@kernel.org Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1a91bf9687af..761557688b18 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -480,6 +480,8 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
480 pmcsr &= ~PCI_PM_CTRL_STATE_MASK; 480 pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
481 pmcsr |= state; 481 pmcsr |= state;
482 break; 482 break;
483 case PCI_D3hot:
484 case PCI_D3cold:
483 case PCI_UNKNOWN: /* Boot-up */ 485 case PCI_UNKNOWN: /* Boot-up */
484 if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot 486 if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot
485 && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) 487 && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET))