diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index e1314212d8d4..7b5093664e49 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -459,6 +459,17 @@ static struct attribute_group dbs_attr_group_old = { | |||
459 | 459 | ||
460 | /************************** sysfs end ************************/ | 460 | /************************** sysfs end ************************/ |
461 | 461 | ||
462 | static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq) | ||
463 | { | ||
464 | if (dbs_tuners_ins.powersave_bias) | ||
465 | freq = powersave_bias_target(p, freq, CPUFREQ_RELATION_H); | ||
466 | else if (p->cur == p->max) | ||
467 | return; | ||
468 | |||
469 | __cpufreq_driver_target(p, freq, dbs_tuners_ins.powersave_bias ? | ||
470 | CPUFREQ_RELATION_L : CPUFREQ_RELATION_H); | ||
471 | } | ||
472 | |||
462 | static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | 473 | static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) |
463 | { | 474 | { |
464 | unsigned int max_load_freq; | 475 | unsigned int max_load_freq; |
@@ -551,19 +562,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
551 | 562 | ||
552 | /* Check for frequency increase */ | 563 | /* Check for frequency increase */ |
553 | if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) { | 564 | if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) { |
554 | /* if we are already at full speed then break out early */ | 565 | dbs_freq_increase(policy, policy->max); |
555 | if (!dbs_tuners_ins.powersave_bias) { | ||
556 | if (policy->cur == policy->max) | ||
557 | return; | ||
558 | |||
559 | __cpufreq_driver_target(policy, policy->max, | ||
560 | CPUFREQ_RELATION_H); | ||
561 | } else { | ||
562 | int freq = powersave_bias_target(policy, policy->max, | ||
563 | CPUFREQ_RELATION_H); | ||
564 | __cpufreq_driver_target(policy, freq, | ||
565 | CPUFREQ_RELATION_L); | ||
566 | } | ||
567 | return; | 566 | return; |
568 | } | 567 | } |
569 | 568 | ||
@@ -610,7 +609,9 @@ static void do_dbs_timer(struct work_struct *work) | |||
610 | /* We want all CPUs to do sampling nearly on same jiffy */ | 609 | /* We want all CPUs to do sampling nearly on same jiffy */ |
611 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 610 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
612 | 611 | ||
613 | delay -= jiffies % delay; | 612 | if (num_online_cpus() > 1) |
613 | delay -= jiffies % delay; | ||
614 | |||
614 | mutex_lock(&dbs_info->timer_mutex); | 615 | mutex_lock(&dbs_info->timer_mutex); |
615 | 616 | ||
616 | /* Common NORMAL_SAMPLE setup */ | 617 | /* Common NORMAL_SAMPLE setup */ |
@@ -635,7 +636,9 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
635 | { | 636 | { |
636 | /* We want all CPUs to do sampling nearly on same jiffy */ | 637 | /* We want all CPUs to do sampling nearly on same jiffy */ |
637 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 638 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
638 | delay -= jiffies % delay; | 639 | |
640 | if (num_online_cpus() > 1) | ||
641 | delay -= jiffies % delay; | ||
639 | 642 | ||
640 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; | 643 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; |
641 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); | 644 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); |