linux-stable/Documentation/driver-api
Rafael J. Wysocki 08810a4119 PM / core: Add NEVER_SKIP and SMART_PREPARE driver flags
The motivation for this change is to provide a way to work around
a problem with the direct-complete mechanism used for avoiding
system suspend/resume handling for devices in runtime suspend.

The problem is that some middle layer code (the PCI bus type and
the ACPI PM domain in particular) returns positive values from its
system suspend ->prepare callbacks regardless of whether the driver's
->prepare returns a positive value or 0, which effectively prevents
drivers from being able to control the direct-complete feature.
Some drivers need that control, however, and the PCI bus type has
grown its own flag to deal with this issue, but since it is not
limited to PCI, it is better to address it by adding driver flags at
the core level.

To that end, add a driver_flags field to struct dev_pm_info for flags
that can be set by device drivers at the probe time to inform the PM
core and/or bus types, PM domains and so on on the capabilities and/or
preferences of device drivers.  Also add two static inline helpers
for setting that field and testing it against a given set of flags
and make the driver core clear it automatically on driver remove
and probe failures.

Define and document two PM driver flags related to the direct-
complete feature: NEVER_SKIP and SMART_PREPARE that can be used,
respectively, to indicate to the PM core that the direct-complete
mechanism should never be used for the device and to inform the
middle layer code (bus types, PM domains etc) that it can only
request the PM core to use the direct-complete mechanism for
the device (by returning a positive value from its ->prepare
callback) if it also has been requested by the driver.

While at it, make the core check pm_runtime_suspended() when
setting power.direct_complete so that it doesn't need to be
checked by ->prepare callbacks.

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>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-11-06 13:55:30 +01:00
..
80211 cfg80211: add intro to documentation 2017-03-31 09:15:46 +02:00
firmware Revert "firmware: add sanity check on shutdown/suspend" 2017-09-10 21:19:06 -07:00
iio docs: IIO documentation sphinx conversion 2017-01-04 13:24:41 -07:00
pm PM / core: Add NEVER_SKIP and SMART_PREPARE driver flags 2017-11-06 13:55:30 +01:00
usb usb: changes for v4.13 merge window 2017-06-20 11:39:34 +08:00
basics.rst docs: Do not include kerneldoc comments from kernel/sys.c 2017-07-17 14:05:36 -06:00
conf.py doc-rst: make driver-api folder buildable stand-alone 2016-10-26 17:25:00 -06:00
device-io.rst docs: Convert the deviceio template to RST 2017-01-31 17:31:21 -07:00
device_link.rst docs / driver-api: Fix structure references in device_link.rst 2017-02-20 16:40:46 -07:00
dma-buf.rst docs: Do not include from .../seqno-fence.c 2017-07-17 14:07:49 -06:00
edac.rst edac.rst: move concepts dictionary from edac.h 2016-12-15 08:58:12 -02:00
frame-buffer.rst
gpio.rst docs: driver-api: Add GPIO section 2017-08-14 15:01:13 +02:00
hsi.rst docs: split up serial-interfaces.rst 2016-09-06 09:14:52 -06:00
i2c.rst Merge branch 'i2c/for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2017-07-12 10:04:56 -07:00
index.rst docs: driver-api: Add GPIO section 2017-08-14 15:01:13 +02:00
infrastructure.rst PM / docs: Drop confusing kernel-doc references from infrastructure.rst 2017-01-03 00:07:09 +01:00
input.rst
libata.rst libata.rst: add c function and struct cross-references 2017-05-16 08:44:11 -03:00
message-based.rst docs: Don't format internal MPT docs 2016-09-06 09:15:48 -06:00
misc_devices.rst docs-rst: core_api: move driver-specific stuff to drivers_api 2017-04-02 14:17:43 -06:00
miscellaneous.rst docs: driver-api: Remove trailing blank line 2017-08-07 14:27:45 -06:00
mtdnand.rst mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
pci.rst docs-rst: core_api: move driver-specific stuff to drivers_api 2017-04-02 14:17:43 -06:00
pinctl.rst pinctrl.txt: move it to the driver-api book 2017-06-20 13:11:14 +02:00
rapidio.rst docs-rst: convert rapidio book to ReST 2017-05-16 08:44:16 -03:00
regulator.rst docs: Convert the regulator docbook to RST 2017-01-31 17:31:41 -07:00
s390-drivers.rst docs: Get the struct cmbdata kernel doc from the right file 2017-07-17 14:19:25 -06:00
scsi.rst docs: Do not include from drivers/scsi/constants.c 2017-07-17 14:27:19 -06:00
sound.rst
spi.rst docs: split up serial-interfaces.rst 2016-09-06 09:14:52 -06:00
uio-howto.rst doc: convert UIO howto from docbook to sphinx 2017-01-31 11:12:41 +01:00
vme.rst docs: Update VME documentation to include kerneldoc comments 2017-03-17 15:10:49 +09:00
w1.rst There has been a fair amount of activity in the docs tree this time 2017-07-03 21:13:25 -07:00