]> git.baikalelectronics.ru Git - kernel.git/commit
PCI PM: make the PM core more careful with drivers using the new PM framework
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 4 Feb 2009 01:09:07 +0000 (02:09 +0100)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 5 Feb 2009 01:22:35 +0000 (17:22 -0800)
commit96b69992e2f8e6b4e9cc0fbf8c78a708c45b38be
tree897947ba605ab479413f7b382f3382a2a9a50a7f
parent95bdbfcf0380814f4ccb7c3802dc6c14edee73d2
PCI PM: make the PM core more careful with drivers using the new PM framework

Currently, the PM core always attempts to manage devices with drivers
that use the new PM framework.  In particular, it attempts to disable
the devices (which is unnecessary), to save their state (which may be
undesirable if the driver has done that already) and to put them into
low power states (again, this may be undesirable if the driver has
already put the device into a low power state).  That need not be
the right thing to do, so make the core be more careful in this
respect.

Generally, there are the following categories of devices to consider:
* bridge devices without drivers
* non-bridge devices without drivers
* bridge devices with drivers
* non-bridge devices with drivers
and each of them should be handled differently.

For bridge devices without drivers the PCI PM core will save their
state on suspend and restore it (early) during resume, after putting
them into D0 if necessary.  It will not attempt to do anything else
to these devices.

For non-bridge devices without drivers the PCI PM core will disable
them and save their state on suspend.  During resume, it will put
them into D0, if necessary, restore their state (early) and reenable
them.

For bridge devices with drivers the PCI PM core will only save
their state on suspend if the driver hasn't done that already.
Still, the core will restore their state (early) during resume,
after putting them into D0, if necessary.

For non-bridge devices with drivers the PCI PM core will only save
their state on suspend if the driver hasn't done that already.  Also,
if the state of the device hasn't been saved by the driver, the core
will attempt to put the device into a low power state.  During
resume the core will restore the state of the device (early), after
putting it into D0, if necessary.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci-driver.c