diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-10-22 18:04:02 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-10-26 15:52:07 +0200 |
commit | 8d89835b0467b7e618c1c93603c1aff85a0c3c66 (patch) | |
tree | 87d331bf331b6c26f4ff870dd39f730b585402f5 /drivers/base/power | |
parent | 928265e3601cde78c7e0a3e518a93b27defed3b1 (diff) | |
download | linux-stable-8d89835b0467b7e618c1c93603c1aff85a0c3c66.tar.gz linux-stable-8d89835b0467b7e618c1c93603c1aff85a0c3c66.tar.bz2 linux-stable-8d89835b0467b7e618c1c93603c1aff85a0c3c66.zip |
PM: suspend: Do not pause cpuidle in the suspend-to-idle path
It is pointless to pause cpuidle in the suspend-to-idle path,
because it is going to be resumed in the same path later and
pausing it does not serve any particular purpose in that case.
Rework the code to avoid doing that.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/base/power')
-rw-r--r-- | drivers/base/power/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index fca6eab871fc..41b2afa3aacc 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -747,8 +747,6 @@ void dpm_resume_noirq(pm_message_t state) resume_device_irqs(); device_wakeup_disarm_wake_irqs(); - - cpuidle_resume(); } /** @@ -881,6 +879,7 @@ void dpm_resume_early(pm_message_t state) void dpm_resume_start(pm_message_t state) { dpm_resume_noirq(state); + cpuidle_resume(); dpm_resume_early(state); } EXPORT_SYMBOL_GPL(dpm_resume_start); @@ -1337,8 +1336,6 @@ int dpm_suspend_noirq(pm_message_t state) { int ret; - cpuidle_pause(); - device_wakeup_arm_wake_irqs(); suspend_device_irqs(); @@ -1522,9 +1519,13 @@ int dpm_suspend_end(pm_message_t state) if (error) goto out; + cpuidle_pause(); + error = dpm_suspend_noirq(state); - if (error) + if (error) { + cpuidle_resume(); dpm_resume_early(resume_event(state)); + } out: dpm_show_time(starttime, state, error, "end"); |