aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2007-10-02 16:28:13 -0400
committerDave Jones <davej@redhat.com>2007-10-04 18:40:57 -0400
commit6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6 (patch)
tree28f8d8af521abb7186836bd7003cec237907b79a /drivers/cpufreq/cpufreq.c
parent1c2562459faedc35927546cfa5273ec6c2884cce (diff)
[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/cpufreq.c')
-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,
1484 unsigned int event) 1484 unsigned int event)
1485{ 1485{
1486 int ret; 1486 int ret;
1487 struct cpufreq_governor *gov = CPUFREQ_PERFORMANCE_GOVERNOR; 1487
1488 /* Only must be defined when default governor is known to have latency
1489 restrictions, like e.g. conservative or ondemand.
1490 That this is the case is already ensured in Kconfig
1491 */
1492#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
1493 struct cpufreq_governor *gov = &cpufreq_gov_performance;
1494#else
1495 struct cpufreq_governor *gov = NULL;
1496#endif
1488 1497
1489 if (policy->governor->max_transition_latency && 1498 if (policy->governor->max_transition_latency &&
1490 policy->cpuinfo.transition_latency > 1499 policy->cpuinfo.transition_latency >
1491 policy->governor->max_transition_latency) { 1500 policy->governor->max_transition_latency) {
1492 printk(KERN_WARNING "%s governor failed, too long" 1501 if (!gov)
1493 " transition latency of HW, fallback" 1502 return -EINVAL;
1494 " to %s governor\n", 1503 else {
1495 policy->governor->name, 1504 printk(KERN_WARNING "%s governor failed, too long"
1496 gov->name); 1505 " transition latency of HW, fallback"
1497 policy->governor = gov; 1506 " to %s governor\n",
1507 policy->governor->name,
1508 gov->name);
1509 policy->governor = gov;
1510 }
1498 } 1511 }
1499 1512
1500 if (!try_module_get(policy->governor->owner)) 1513 if (!try_module_get(policy->governor->owner))