devices.rst (e07515563d010d8b32967634e8dc2fdc732c1aa6) devices.rst (2a3f34750b8b07df42ab4b30b70e029d46e0d7f3)
1.. SPDX-License-Identifier: GPL-2.0
2.. include:: <isonum.txt>
3
4.. |struct dev_pm_ops| replace:: :c:type:`struct dev_pm_ops <dev_pm_ops>`
5.. |struct dev_pm_domain| replace:: :c:type:`struct dev_pm_domain <dev_pm_domain>`
6.. |struct bus_type| replace:: :c:type:`struct bus_type <bus_type>`
7.. |struct device_type| replace:: :c:type:`struct device_type <device_type>`
8.. |struct class| replace:: :c:type:`struct class <class>`

--- 789 unchanged lines hidden (view full) ---

798the full-power state, as explained in :file:`Documentation/power/runtime_pm.rst`.
799[Refer to that document for more information regarding this particular issue as
800well as for information on the device runtime power management framework in
801general.]
802
803However, it often is desirable to leave devices in suspend after system
804transitions to the working state, especially if those devices had been in
805runtime suspend before the preceding system-wide suspend (or analogous)
1.. SPDX-License-Identifier: GPL-2.0
2.. include:: <isonum.txt>
3
4.. |struct dev_pm_ops| replace:: :c:type:`struct dev_pm_ops <dev_pm_ops>`
5.. |struct dev_pm_domain| replace:: :c:type:`struct dev_pm_domain <dev_pm_domain>`
6.. |struct bus_type| replace:: :c:type:`struct bus_type <bus_type>`
7.. |struct device_type| replace:: :c:type:`struct device_type <device_type>`
8.. |struct class| replace:: :c:type:`struct class <class>`

--- 789 unchanged lines hidden (view full) ---

798the full-power state, as explained in :file:`Documentation/power/runtime_pm.rst`.
799[Refer to that document for more information regarding this particular issue as
800well as for information on the device runtime power management framework in
801general.]
802
803However, it often is desirable to leave devices in suspend after system
804transitions to the working state, especially if those devices had been in
805runtime suspend before the preceding system-wide suspend (or analogous)
806transition. Device drivers can use the ``DPM_FLAG_LEAVE_SUSPENDED`` flag to
806transition. Device drivers can use the ``DPM_FLAG_MAY_SKIP_RESUME`` flag to
807indicate to the PM core (and middle-layer code) that they prefer the specific
808devices handled by them to be left suspended and they have no problems with
809skipping their system-wide resume callbacks for this reason. Whether or not the
810devices will actually be left in suspend may depend on their state before the
811given system suspend-resume cycle and on the type of the system transition under
812way. In particular, devices are not left suspended if that transition is a
813restore from hibernation, as device states are not guaranteed to be reflected
814by the information stored in the hibernation image in that case.

--- 5 unchanged lines hidden (view full) ---

820transition. The middle layer is then responsible for handling the device as
821appropriate in its "noirq" resume callback, which is executed regardless of
822whether or not the device is left suspended, but the other resume callbacks
823(except for ``->complete``) will be skipped automatically by the PM core if the
824device really can be left in suspend.
825
826For devices whose "noirq", "late" and "early" driver callbacks are invoked
827directly by the PM core, all of the system-wide resume callbacks are skipped if
807indicate to the PM core (and middle-layer code) that they prefer the specific
808devices handled by them to be left suspended and they have no problems with
809skipping their system-wide resume callbacks for this reason. Whether or not the
810devices will actually be left in suspend may depend on their state before the
811given system suspend-resume cycle and on the type of the system transition under
812way. In particular, devices are not left suspended if that transition is a
813restore from hibernation, as device states are not guaranteed to be reflected
814by the information stored in the hibernation image in that case.

--- 5 unchanged lines hidden (view full) ---

820transition. The middle layer is then responsible for handling the device as
821appropriate in its "noirq" resume callback, which is executed regardless of
822whether or not the device is left suspended, but the other resume callbacks
823(except for ``->complete``) will be skipped automatically by the PM core if the
824device really can be left in suspend.
825
826For devices whose "noirq", "late" and "early" driver callbacks are invoked
827directly by the PM core, all of the system-wide resume callbacks are skipped if
828``DPM_FLAG_LEAVE_SUSPENDED`` is set and the device is in runtime suspend during
828``DPM_FLAG_MAY_SKIP_RESUME`` is set and the device is in runtime suspend during
829the ``suspend_noirq`` (or analogous) phase or the transition under way is a
830proper system suspend (rather than anything related to hibernation) and the
831device's wakeup settings are suitable for runtime PM (that is, it cannot
832generate wakeup signals at all or it is allowed to wake up the system from
833sleep).
829the ``suspend_noirq`` (or analogous) phase or the transition under way is a
830proper system suspend (rather than anything related to hibernation) and the
831device's wakeup settings are suitable for runtime PM (that is, it cannot
832generate wakeup signals at all or it is allowed to wake up the system from
833sleep).