summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2007-10-02 13:28:13 -0700
committerDave Jones <davej@redhat.com>2007-10-04 18:40:57 -0400
commit6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6 (patch)
tree28f8d8af521abb7186836bd7003cec237907b79a /drivers/cpufreq
parent1c2562459faedc35927546cfa5273ec6c2884cce (diff)
downloadlinux-6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6.tar.gz
linux-6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6.tar.bz2
linux-6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6.zip
[CPUFREQ] Only check for transition latency on problematic governors (kconfig fix)
Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 418522f88f73..65ac58511228 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1484,17 +1484,30 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
unsigned int event)
{
int ret;
- struct cpufreq_governor *gov = CPUFREQ_PERFORMANCE_GOVERNOR;
+
+ /* Only must be defined when default governor is known to have latency
+ restrictions, like e.g. conservative or ondemand.
+ That this is the case is already ensured in Kconfig
+ */
+#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
+ struct cpufreq_governor *gov = &cpufreq_gov_performance;
+#else
+ struct cpufreq_governor *gov = NULL;
+#endif
if (policy->governor->max_transition_latency &&
policy->cpuinfo.transition_latency >
policy->governor->max_transition_latency) {
- printk(KERN_WARNING "%s governor failed, too long"
- " transition latency of HW, fallback"
- " to %s governor\n",
- policy->governor->name,
- gov->name);
- policy->governor = gov;
+ if (!gov)
+ return -EINVAL;
+ else {
+ printk(KERN_WARNING "%s governor failed, too long"
+ " transition latency of HW, fallback"
+ " to %s governor\n",
+ policy->governor->name,
+ gov->name);
+ policy->governor = gov;
+ }
}
if (!try_module_get(policy->governor->owner))