aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2011-02-07 11:14:25 -0500
committerDave Jones <davej@redhat.com>2011-03-16 17:54:31 -0400
commit5cb2c3bd0c5e0f3ced63f250ec2ad59d7c5c626a (patch)
tree148f10ad6586d0f6f0046f18bd5cd4720f3b3ed3 /drivers/cpufreq/cpufreq_ondemand.c
parent5b95364f6101d67a073a5ec18d726e94e02ca605 (diff)
[CPUFREQ] calculate delay after dbs_check_cpu
calculate ondemand delay after dbs_check_cpu call because it can modify rate_mult value use freq_lo_jiffies value for the sub sample period of powersave_bias mode Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 58aa85ea5ec6..059179db1985 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -642,12 +642,7 @@ static void do_dbs_timer(struct work_struct *work)
642 unsigned int cpu = dbs_info->cpu; 642 unsigned int cpu = dbs_info->cpu;
643 int sample_type = dbs_info->sample_type; 643 int sample_type = dbs_info->sample_type;
644 644
645 /* We want all CPUs to do sampling nearly on same jiffy */ 645 int delay;
646 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
647 * dbs_info->rate_mult);
648
649 if (num_online_cpus() > 1)
650 delay -= jiffies % delay;
651 646
652 mutex_lock(&dbs_info->timer_mutex); 647 mutex_lock(&dbs_info->timer_mutex);
653 648
@@ -660,10 +655,20 @@ static void do_dbs_timer(struct work_struct *work)
660 /* Setup timer for SUB_SAMPLE */ 655 /* Setup timer for SUB_SAMPLE */
661 dbs_info->sample_type = DBS_SUB_SAMPLE; 656 dbs_info->sample_type = DBS_SUB_SAMPLE;
662 delay = dbs_info->freq_hi_jiffies; 657 delay = dbs_info->freq_hi_jiffies;
658 } else {
659 /* We want all CPUs to do sampling nearly on
660 * same jiffy
661 */
662 delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
663 * dbs_info->rate_mult);
664
665 if (num_online_cpus() > 1)
666 delay -= jiffies % delay;
663 } 667 }
664 } else { 668 } else {
665 __cpufreq_driver_target(dbs_info->cur_policy, 669 __cpufreq_driver_target(dbs_info->cur_policy,
666 dbs_info->freq_lo, CPUFREQ_RELATION_H); 670 dbs_info->freq_lo, CPUFREQ_RELATION_H);
671 delay = dbs_info->freq_lo_jiffies;
667 } 672 }
668 schedule_delayed_work_on(cpu, &dbs_info->work, delay); 673 schedule_delayed_work_on(cpu, &dbs_info->work, delay);
669 mutex_unlock(&dbs_info->timer_mutex); 674 mutex_unlock(&dbs_info->timer_mutex);