diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 27 |
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)) |