Skip to content

Commit 450316d

Browse files
rfvirgilrafaeljw
authored andcommitted
PM: runtime: Document that force_suspend() is incompatible with SMART_SUSPEND
pm_runtime_force_suspend() cannot be used with DPM_FLAG_SMART_SUSPEND, so note this in the kerneldoc. If DPM_FLAG_SMART_SUSPEND is set and the PM core cannot skip system resume it will call pm_runtime_active() on the driver. This can lead to an inconsistent state where: pm_runtime_force_suspend() called ->runtime_suspend but device_resume_noirq() called pm_runtime_set_active() This leaves the driver actually suspended but marked as active. Signed-off-by: Richard Fitzgerald <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b7bfaa7 commit 450316d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/base/power/runtime.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,10 @@ static bool pm_runtime_need_not_resume(struct device *dev)
18641864
* sure the device is put into low power state and it should only be used during
18651865
* system-wide PM transitions to sleep states. It assumes that the analogous
18661866
* pm_runtime_force_resume() will be used to resume the device.
1867+
*
1868+
* Do not use with DPM_FLAG_SMART_SUSPEND as this can lead to an inconsistent
1869+
* state where this function has called the ->runtime_suspend callback but the
1870+
* PM core marks the driver as runtime active.
18671871
*/
18681872
int pm_runtime_force_suspend(struct device *dev)
18691873
{

0 commit comments

Comments
 (0)