]> git.baikalelectronics.ru Git - kernel.git/commit
PM: sleep: Pause cpuidle later and resume it earlier during system transitions
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 22 Oct 2021 16:07:47 +0000 (18:07 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 26 Oct 2021 13:52:07 +0000 (15:52 +0200)
commit4df1e0743e4e16a29fa6466dbf4135df8e86ac88
tree1a3b952983081d491bd9e5d6fa9f7e8ad52c3eec
parentf146da28dd2f056d5c54ca3e47aad377f5d2c5ec
PM: sleep: Pause cpuidle later and resume it earlier during system transitions

Commit 22e5ef285180 ("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>
drivers/base/power/main.c
kernel/power/hibernate.c
kernel/power/power.h
kernel/power/suspend.c