Skip to content

Commit a2bd7be

Browse files
storulfrafaeljw
authored andcommitted
PM: sleep: Fix runtime PM based cpuidle support
In the cpuidle-psci case, runtime PM in combination with the generic PM domain (genpd), may be used when entering/exiting a shared idlestate. More precisely, genpd relies on runtime PM to be enabled for the attached device (in this case it belongs to a CPU), to properly manage the reference counting of its PM domain. This works fine most of the time, but during system suspend in dpm_suspend_late(), the PM core disables runtime PM for all devices. Beyond this point, calls to pm_runtime_get_sync() to runtime resume a device may fail and therefore it could also mess up the reference counting in genpd. To fix this problem, let's call wake_up_all_idle_cpus() in dpm_suspend_late(), prior to disabling runtime PM. In this way a device that belongs to a CPU, becomes runtime resumed through cpuidle-psci and stays like that, because the runtime PM usage count has been bumped in device_prepare(). Diagnosed-by: Maulik Shah <[email protected]> Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 833db72 commit a2bd7be

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/base/power/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,7 @@ int dpm_suspend_late(pm_message_t state)
14631463
int error = 0;
14641464

14651465
trace_suspend_resume(TPS("dpm_suspend_late"), state.event, true);
1466+
wake_up_all_idle_cpus();
14661467
mutex_lock(&dpm_list_mtx);
14671468
pm_transition = state;
14681469
async_error = 0;

0 commit comments

Comments
 (0)