linux/Documentation/power
Rafael J. Wysocki c4b65157ae PCI / PM: Take SMART_SUSPEND driver flag into account
Make the PCI bus type take DPM_FLAG_SMART_SUSPEND into account in its
system-wide PM callbacks and make sure that all code that should not
run in parallel with pci_pm_runtime_resume() is executed in the "late"
phases of system suspend, freeze and poweroff transitions.

[Note that the pm_runtime_suspended() check in pci_dev_keep_suspended()
is an optimization, because if is not passed, all of the subsequent
checks may be skipped and some of them are much more overhead in
general.]

Also use the observation that if the device is in runtime suspend
at the beginning of the "late" phase of a system-wide suspend-like
transition, its state cannot change going forward (runtime PM is
disabled for it at that time) until the transition is over and the
subsequent system-wide PM callbacks should be skipped for it (as
they generally assume the device to not be suspended), so add checks
for that in pci_pm_suspend_late/noirq(), pci_pm_freeze_late/noirq()
and pci_pm_poweroff_late/noirq().

Moreover, if pci_pm_resume_noirq() or pci_pm_restore_noirq() is
called during the subsequent system-wide resume transition and if
the device was left in runtime suspend previously, its runtime PM
status needs to be changed to "active" as it is going to be put
into the full-power state, so add checks for that too to these
functions.

In turn, if pci_pm_thaw_noirq() runs after the device has been
left in runtime suspend, the subsequent "thaw" callbacks need
to be skipped for it (as they may not work correctly with a
suspended device), so set the power.direct_complete flag for the
device then to make the PM core skip those callbacks.

In addition to the above add a core helper for checking if
DPM_FLAG_SMART_SUSPEND is set and the device runtime PM status is
"suspended" at the same time, which is done quite often in the new
code (and will be done elsewhere going forward too).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
2017-11-06 13:57:46 +01:00
..
powercap PowerCap: Documentation 2013-10-17 00:36:06 +02:00
regulator regulator: Rename regulator_set_optimum_mode 2015-03-09 18:32:25 +00:00
00-INDEX PM / sleep / docs: Convert PM notifiers document to reST 2017-02-06 11:26:02 -07:00
apm-acpi.txt
basic-pm-debugging.txt PM / sleep: Update some system sleep documentation 2016-08-13 02:54:04 +02:00
charger-manager.txt Documentation: Charger Manager: Fix spelling mistakes 2014-09-16 11:01:27 +02:00
drivers-testing.txt
freezing-of-tasks.txt PM / sleep / docs: Convert PM notifiers document to reST 2017-02-06 11:26:02 -07:00
interface.txt PM / sleep: Update some system sleep documentation 2016-08-13 02:54:04 +02:00
opp.txt PM / OPP: Update Documentation to remove RCU specific bits 2017-01-30 09:22:23 +01:00
pci.txt PCI / PM: Take SMART_SUSPEND driver flag into account 2017-11-06 13:57:46 +01:00
pm_qos_interface.txt PM / QoS: Drop PM_QOS_FLAG_REMOTE_WAKEUP 2017-10-14 01:04:31 +02:00
power_supply_class.txt power: supply: core: Add power_supply_prop_precharge 2017-06-08 16:29:28 +02:00
runtime_pm.txt PM / runtime: Document new pm_runtime_set_suspended() constraint 2017-07-27 23:57:40 +02:00
s2ram.txt PM / sleep: Mention async suspend in PM_TRACE documentation 2015-01-30 01:29:46 +01:00
suspend-and-cpuhotplug.txt cpu-hotplug: convert cpu_hotplug_disabled to a counter 2015-08-05 11:46:44 -07:00
suspend-and-interrupts.txt genirq / PM: describe IRQF_COND_SUSPEND 2015-03-06 01:28:14 +01:00
swsusp-and-swap-files.txt
swsusp-dmcrypt.txt docs: fix locations of several documents that got moved 2016-10-24 08:12:35 -02:00
swsusp.txt docs-rst: fix usb cross-references 2017-04-11 14:41:29 -06:00
tricks.txt
userland-swsusp.txt Documentation: power: Fix typo in Documentation/power 2014-11-08 09:15:14 -05:00
video.txt