aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_conservative.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_conservative.c')
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index ce5248e04218..526bfbf69611 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -428,6 +428,7 @@ static struct attribute_group dbs_attr_group_old = {
428static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) 428static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
429{ 429{
430 unsigned int load = 0; 430 unsigned int load = 0;
431 unsigned int max_load = 0;
431 unsigned int freq_target; 432 unsigned int freq_target;
432 433
433 struct cpufreq_policy *policy; 434 struct cpufreq_policy *policy;
@@ -485,6 +486,9 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
485 continue; 486 continue;
486 487
487 load = 100 * (wall_time - idle_time) / wall_time; 488 load = 100 * (wall_time - idle_time) / wall_time;
489
490 if (load > max_load)
491 max_load = load;
488 } 492 }
489 493
490 /* 494 /*
@@ -495,7 +499,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
495 return; 499 return;
496 500
497 /* Check for frequency increase */ 501 /* Check for frequency increase */
498 if (load > dbs_tuners_ins.up_threshold) { 502 if (max_load > dbs_tuners_ins.up_threshold) {
499 this_dbs_info->down_skip = 0; 503 this_dbs_info->down_skip = 0;
500 504
501 /* if we are already at full speed then break out early */ 505 /* if we are already at full speed then break out early */
@@ -522,7 +526,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
522 * can support the current CPU usage without triggering the up 526 * can support the current CPU usage without triggering the up
523 * policy. To be safe, we focus 10 points under the threshold. 527 * policy. To be safe, we focus 10 points under the threshold.
524 */ 528 */
525 if (load < (dbs_tuners_ins.down_threshold - 10)) { 529 if (max_load < (dbs_tuners_ins.down_threshold - 10)) {
526 freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100; 530 freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
527 531
528 this_dbs_info->requested_freq -= freq_target; 532 this_dbs_info->requested_freq -= freq_target;