aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-04-18 00:48:32 +0100
committerMark Brown <broonie@linaro.org>2014-04-23 23:54:52 +0100
commitadb665056afe23db0687c1d1a208806c108add08 (patch)
tree3a36a782bf18e04f5be85e4eded6b14a96b29c93 /include
parent682a3d0201261152f489138d5f034742bccbfe9a (diff)
cpufreq: suspend governors on system suspend/hibernate
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 the tunables configuration for clusters/sockets with non-boot CPUs was lost after system suspend/resume, as we were notifying governors with CPUFREQ_GOV_POLICY_EXIT on removal of the last CPU for that policy which caused the tunables memory to be freed. This is fixed by preventing any governor operations from being carried out between the device suspend and device resume stages of system suspend and resume, respectively. We could have added these callbacks at dpm_{suspend|resume}_noirq() level, but there is an additional problem that the majority of I/O devices is already suspended at that point and if cpufreq drivers want to change the frequency before suspending, then that not be possible on some platforms (which depend on 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> [rjw: Changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry-picked from 2f0aea9363609433b38ab13f0f86f38372668c68) Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cpufreq.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 037d36ae63e5..00b0e0a9fca3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -306,6 +306,18 @@ struct freq_attr {
static struct freq_attr _name = \
__ATTR(_name, 0444, show_##_name, NULL)
+#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 *
+ *********************************************************************/
+
#define cpufreq_freq_attr_ro_perm(_name, _perm) \
static struct freq_attr _name = \
__ATTR(_name, _perm, show_##_name, NULL)