summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2014-09-18 15:03:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 13:41:10 -0700
commit8f91119341c98f7645777985e23e34600957c234 (patch)
tree9e375fb3eb044c170771aa4c22b4ce043d991d78
parent168d02c742eca20fabafddf49305a1e254be1a6d (diff)
cpufreq: fix cpufreq suspend/resume for intel_pstate
commit 8e30444e153008e8eb3e74cbcb7a865bfcfb04a0 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: 2f0aea936360 (cpufreq: suspend governors on system suspend/hibernate) Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> [rjw: Subject] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/cpufreq/cpufreq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0e8f8234f9b3..1edeaad718df 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -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__,