Commit 8f911193 authored by Lan Tianyu's avatar Lan Tianyu Committed by Greg Kroah-Hartman

cpufreq: fix cpufreq suspend/resume for intel_pstate

commit 8e30444e upstream.

Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
for cpufreq drivers which have target or target_index callback. This
skips intel_pstate driver. This patch is to set the flag before checking
target or target_index callback.

Fixes: 2f0aea93 (cpufreq: suspend governors on system suspend/hibernate)
Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
[rjw: Subject]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 168d02c7
......@@ -1666,6 +1666,8 @@ void cpufreq_suspend(void)
if (!cpufreq_driver)
return;
cpufreq_suspended = true;
if (!has_target())
return;
......@@ -1680,8 +1682,6 @@ void cpufreq_suspend(void)
pr_err("%s: Failed to suspend driver: %p\n", __func__,
policy);
}
cpufreq_suspended = true;
}
/**
......@@ -1697,13 +1697,13 @@ void cpufreq_resume(void)
if (!cpufreq_driver)
return;
cpufreq_suspended = false;
if (!has_target())
return;
pr_debug("%s: Resuming Governors\n", __func__);
cpufreq_suspended = false;
list_for_each_entry(policy, &cpufreq_policy_list, policy_list) {
if (cpufreq_driver->resume && cpufreq_driver->resume(policy))
pr_err("%s: Failed to resume driver: %p\n", __func__,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment