@@ -1004,41 +1004,39 @@ including the PCI bus type. The flags should be set once at the driver probe
10041004time with the help of the dev_pm_set_driver_flags() function and they should not
10051005be updated directly afterwards.
10061006
1007- The DPM_FLAG_NEVER_SKIP flag prevents the PM core from using the direct-complete
1008- mechanism allowing device suspend/resume callbacks to be skipped if the device
1009- is in runtime suspend when the system suspend starts. That also affects all of
1010- the ancestors of the device, so this flag should only be used if absolutely
1011- necessary.
1012-
1013- The DPM_FLAG_SMART_PREPARE flag instructs the PCI bus type to only return a
1014- positive value from pci_pm_prepare() if the ->prepare callback provided by the
1007+ The DPM_FLAG_NO_DIRECT_COMPLETE flag prevents the PM core from using the
1008+ direct-complete mechanism allowing device suspend/resume callbacks to be skipped
1009+ if the device is in runtime suspend when the system suspend starts. That also
1010+ affects all of the ancestors of the device, so this flag should only be used if
1011+ absolutely necessary.
1012+
1013+ The DPM_FLAG_SMART_PREPARE flag causes the PCI bus type to return a positive
1014+ value from pci_pm_prepare() only if the ->prepare callback provided by the
10151015driver of the device returns a positive value. That allows the driver to opt
1016- out from using the direct-complete mechanism dynamically.
1016+ out from using the direct-complete mechanism dynamically (whereas setting
1017+ DPM_FLAG_NO_DIRECT_COMPLETE means permanent opt-out).
10171018
10181019The DPM_FLAG_SMART_SUSPEND flag tells the PCI bus type that from the driver's
10191020perspective the device can be safely left in runtime suspend during system
10201021suspend. That causes pci_pm_suspend(), pci_pm_freeze() and pci_pm_poweroff()
1021- to skip resuming the device from runtime suspend unless there are PCI-specific
1022- reasons for doing that. Also, it causes pci_pm_suspend_late/noirq(),
1023- pci_pm_freeze_late/noirq() and pci_pm_poweroff_late/noirq() to return early
1024- if the device remains in runtime suspend in the beginning of the "late" phase
1025- of the system-wide transition under way. Moreover, if the device is in
1026- runtime suspend in pci_pm_resume_noirq() or pci_pm_restore_noirq(), its runtime
1027- power management status will be changed to "active" (as it is going to be put
1028- into D0 going forward), but if it is in runtime suspend in pci_pm_thaw_noirq(),
1029- the function will set the power.direct_complete flag for it (to make the PM core
1030- skip the subsequent "thaw" callbacks for it) and return.
1031-
1032- Setting the DPM_FLAG_LEAVE_SUSPENDED flag means that the driver prefers the
1033- device to be left in suspend after system-wide transitions to the working state.
1034- This flag is checked by the PM core, but the PCI bus type informs the PM core
1035- which devices may be left in suspend from its perspective (that happens during
1036- the "noirq" phase of system-wide suspend and analogous transitions) and next it
1037- uses the dev_pm_may_skip_resume() helper to decide whether or not to return from
1038- pci_pm_resume_noirq() early, as the PM core will skip the remaining resume
1039- callbacks for the device during the transition under way and will set its
1040- runtime PM status to "suspended" if dev_pm_may_skip_resume() returns "true" for
1041- it.
1022+ to avoid resuming the device from runtime suspend unless there are PCI-specific
1023+ reasons for doing that. Also, it causes pci_pm_suspend_late/noirq() and
1024+ pci_pm_poweroff_late/noirq() to return early if the device remains in runtime
1025+ suspend during the "late" phase of the system-wide transition under way.
1026+ Moreover, if the device is in runtime suspend in pci_pm_resume_noirq() or
1027+ pci_pm_restore_noirq(), its runtime PM status will be changed to "active" (as it
1028+ is going to be put into D0 going forward).
1029+
1030+ Setting the DPM_FLAG_MAY_SKIP_RESUME flag means that the driver allows its
1031+ "noirq" and "early" resume callbacks to be skipped if the device can be left
1032+ in suspend after a system-wide transition into the working state. This flag is
1033+ taken into consideration by the PM core along with the power.may_skip_resume
1034+ status bit of the device which is set by pci_pm_suspend_noirq() in certain
1035+ situations. If the PM core determines that the driver's "noirq" and "early"
1036+ resume callbacks should be skipped, the dev_pm_skip_resume() helper function
1037+ will return "true" and that will cause pci_pm_resume_noirq() and
1038+ pci_pm_resume_early() to return upfront without touching the device and
1039+ executing the driver callbacks.
10421040
104310413.2. Device Runtime Power Management
10441042------------------------------------
0 commit comments