aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 69aa1db8336c..956d121cb161 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -84,6 +84,7 @@ struct dbs_tuners {
84static struct dbs_tuners dbs_tuners_ins = { 84static struct dbs_tuners dbs_tuners_ins = {
85 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD, 85 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
86 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR, 86 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
87 .ignore_nice = 0,
87}; 88};
88 89
89static inline unsigned int get_cpu_idle_time(unsigned int cpu) 90static inline unsigned int get_cpu_idle_time(unsigned int cpu)
@@ -350,6 +351,9 @@ static void dbs_check_cpu(int cpu)
350 freq_next = (freq_next * policy->cur) / 351 freq_next = (freq_next * policy->cur) /
351 (dbs_tuners_ins.up_threshold - 10); 352 (dbs_tuners_ins.up_threshold - 10);
352 353
354 if (freq_next < policy->min)
355 freq_next = policy->min;
356
353 if (freq_next <= ((policy->cur * 95) / 100)) 357 if (freq_next <= ((policy->cur * 95) / 100))
354 __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L); 358 __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);
355} 359}
@@ -395,8 +399,11 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
395 return -EINVAL; 399 return -EINVAL;
396 400
397 if (policy->cpuinfo.transition_latency > 401 if (policy->cpuinfo.transition_latency >
398 (TRANSITION_LATENCY_LIMIT * 1000)) 402 (TRANSITION_LATENCY_LIMIT * 1000)) {
403 printk(KERN_WARNING "ondemand governor failed to load "
404 "due to too long transition latency\n");
399 return -EINVAL; 405 return -EINVAL;
406 }
400 if (this_dbs_info->enable) /* Already enabled */ 407 if (this_dbs_info->enable) /* Already enabled */
401 break; 408 break;
402 409
@@ -431,8 +438,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
431 def_sampling_rate = MIN_STAT_SAMPLING_RATE; 438 def_sampling_rate = MIN_STAT_SAMPLING_RATE;
432 439
433 dbs_tuners_ins.sampling_rate = def_sampling_rate; 440 dbs_tuners_ins.sampling_rate = def_sampling_rate;
434 dbs_tuners_ins.ignore_nice = 0;
435
436 dbs_timer_init(); 441 dbs_timer_init();
437 } 442 }
438 443