• Rafael J. Wysocki's avatar
    PM: sleep: Pause cpuidle later and resume it earlier during system transitions · 23f62d7a
    Rafael J. Wysocki authored
    Commit 8651f97b ("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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Tested-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    23f62d7a
main.c 49.9 KB