summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2011-02-07 17:14:25 +0100
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-03 14:34:52 -0700
commit89eee00adb5751e228eba3f543ead8ced0e76e12 (patch)
tree6859cb76e6da1de7735d71db23825c588d35097f
parentfa15f86b0ca538c2bed43ac81fc1a2b246a44fcc (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> (cherry picked from commit 5cb2c3bd0c5e0f3ced63f250ec2ad59d7c5c626a) Reviewed-on: http://git.kernel.org/?p=linux/kernel/git/torvalds/ linux-2.6.git;a=commit;h=5cb2c3bd0c5e0f3ced63f250ec2ad59d7c5c626a Change-Id: I723807908ee0de5f0ba602467664b18545d6bdb9 Reviewed-on: http://git-master/r/34512 Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
-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)
unsigned int cpu = dbs_info->cpu;
int sample_type = dbs_info->sample_type;
- /* We want all CPUs to do sampling nearly on same jiffy */
- int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
- * dbs_info->rate_mult);
-
- if (num_online_cpus() > 1)
- delay -= jiffies % delay;
+ int delay;
mutex_lock(&dbs_info->timer_mutex);
@@ -660,10 +655,20 @@ static void do_dbs_timer(struct work_struct *work)
/* Setup timer for SUB_SAMPLE */
dbs_info->sample_type = DBS_SUB_SAMPLE;
delay = dbs_info->freq_hi_jiffies;
+ } else {
+ /* We want all CPUs to do sampling nearly on
+ * same jiffy
+ */
+ delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
+ * dbs_info->rate_mult);
+
+ if (num_online_cpus() > 1)
+ delay -= jiffies % delay;
}
} else {
__cpufreq_driver_target(dbs_info->cur_policy,
dbs_info->freq_lo, CPUFREQ_RELATION_H);
+ delay = dbs_info->freq_lo_jiffies;
}
schedule_delayed_work_on(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);