summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@linaro.org>2014-03-04 11:00:26 +0800
committerNishanth Menon <nm@ti.com>2014-07-28 08:07:26 -0500
commit9e9d0fc1c45716af973fd73c6a205c35d3685fa8 (patch)
tree1a598bfa1cbe9c83cb3af334ecc8192cb36618bd /include
parent3b167e02f5de9c5ba213c4795c4f22e419cc7aa5 (diff)
cpufreq: suspend governors on system suspend/hibernate
[ Upstream commit 2f0aea9363609433b38ab13f0f86f38372668c68 ] This patch adds cpufreq suspend/resume calls to dpm_{suspend|resume}() for handling suspend/resume of cpufreq governors. Lan Tianyu (Intel) & Jinhyuk Choi (Broadcom) found an issue where tunables configuration for clusters/sockets with non-boot CPUs was getting lost after suspend/resume, as we were notifying governors with CPUFREQ_GOV_POLICY_EXIT on removal of the last cpu for that policy and so deallocating memory for tunables. This is fixed by this patch as we don't allow any operation on governors after device suspend and before device resume now. We could have added these callbacks at dpm_{suspend|resume}_noirq() level but the problem here is that most of the devices (i.e. devices with ->suspend() callbacks) have already been suspended by now and so if drivers want to change frequency before suspending, then it might not be possible for many platforms (which depend on other peripherals like i2c, regulators, etc). Reported-and-tested-by: Lan Tianyu <tianyu.lan@intel.com> Reported-by: Jinhyuk Choi <jinchoi@broadcom.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cpufreq.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 3642189296c..ef42824cbe5 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -296,6 +296,14 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
policy->cpuinfo.max_freq);
}
+#ifdef CONFIG_CPU_FREQ
+void cpufreq_suspend(void);
+void cpufreq_resume(void);
+#else
+static inline void cpufreq_suspend(void) {}
+static inline void cpufreq_resume(void) {}
+#endif
+
/*********************************************************************
* CPUFREQ NOTIFIER INTERFACE *
*********************************************************************/