PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3
commitb0ab1f1632e9df08ddc86e0996253edb3f8e8e8c
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 18 May 2009 20:51:12 +0000 (18 22:51 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:50:31 +0000 (2 16:50 -0700)
tree54f47c69daccaab39b90f4f8bd19e897beba6004
parentef2004be0c36733794512cb0a6ebb8f73efb682b
PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3

commit f62795f1e892ca9269849fa83de97621da7e02c0 upstream.

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.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pci.c