summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-22 18:07:47 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-26 15:52:07 +0200
commit23f62d7ab25bd1a7dbbb89cfcd429df7735855af (patch)
tree1a3b952983081d491bd9e5d6fa9f7e8ad52c3eec /drivers/base
parent8d89835b0467b7e618c1c93603c1aff85a0c3c66 (diff)
downloadlinux-23f62d7ab25bd1a7dbbb89cfcd429df7735855af.tar.bz2
PM: sleep: Pause cpuidle later and resume it earlier during system transitions
Commit 8651f97bd951 ("PM / cpuidle: System resume hang fix with cpuidle") that introduced cpuidle pausing during system suspend did that to work around a platform firmware issue causing systems to hang during resume if CPUs were allowed to enter idle states in the system suspend and resume code paths. However, pausing cpuidle before the last phase of suspending devices is the source of an otherwise arbitrary difference between the suspend-to-idle path and other system suspend variants, so it is cleaner to do that later, before taking secondary CPUs offline (it is still safer to take secondary CPUs offline with cpuidle paused, though). Modify the code accordingly, but in order to avoid code duplication, introduce new wrapper functions, pm_sleep_disable_secondary_cpus() and pm_sleep_enable_secondary_cpus(), to combine cpuidle_pause() and cpuidle_resume(), respectively, with the handling of secondary CPUs during system-wide transitions to sleep states. 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')
-rw-r--r--drivers/base/power/main.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 41b2afa3aacc..ac4dde8fdb8b 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -32,7 +32,6 @@
#include <linux/suspend.h>
#include <trace/events/power.h>
#include <linux/cpufreq.h>
-#include <linux/cpuidle.h>
#include <linux/devfreq.h>
#include <linux/timer.h>
@@ -879,7 +878,6 @@ 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);
@@ -1519,13 +1517,9 @@ int dpm_suspend_end(pm_message_t state)
if (error)
goto out;
- cpuidle_pause();
-
error = dpm_suspend_noirq(state);
- if (error) {
- cpuidle_resume();
+ if (error)
dpm_resume_early(resume_event(state));
- }
out:
dpm_show_time(starttime, state, error, "end");