diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 15e80ee61352..c90d345c636a 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -224,34 +224,32 @@ static void od_dbs_timer(struct work_struct *work) | |||
224 | cpu); | 224 | cpu); |
225 | struct dbs_data *dbs_data = dbs_info->cdbs.cur_policy->governor_data; | 225 | struct dbs_data *dbs_data = dbs_info->cdbs.cur_policy->governor_data; |
226 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; | 226 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; |
227 | int delay, sample_type = core_dbs_info->sample_type; | 227 | int delay = 0, sample_type = core_dbs_info->sample_type; |
228 | bool eval_load; | ||
229 | 228 | ||
230 | mutex_lock(&core_dbs_info->cdbs.timer_mutex); | 229 | mutex_lock(&core_dbs_info->cdbs.timer_mutex); |
231 | eval_load = need_load_eval(&core_dbs_info->cdbs, | 230 | if (!need_load_eval(&core_dbs_info->cdbs, od_tuners->sampling_rate)) |
232 | od_tuners->sampling_rate); | 231 | goto max_delay; |
233 | 232 | ||
234 | /* Common NORMAL_SAMPLE setup */ | 233 | /* Common NORMAL_SAMPLE setup */ |
235 | core_dbs_info->sample_type = OD_NORMAL_SAMPLE; | 234 | core_dbs_info->sample_type = OD_NORMAL_SAMPLE; |
236 | if (sample_type == OD_SUB_SAMPLE) { | 235 | if (sample_type == OD_SUB_SAMPLE) { |
237 | delay = core_dbs_info->freq_lo_jiffies; | 236 | delay = core_dbs_info->freq_lo_jiffies; |
238 | if (eval_load) | 237 | __cpufreq_driver_target(core_dbs_info->cdbs.cur_policy, |
239 | __cpufreq_driver_target(core_dbs_info->cdbs.cur_policy, | 238 | core_dbs_info->freq_lo, CPUFREQ_RELATION_H); |
240 | core_dbs_info->freq_lo, | ||
241 | CPUFREQ_RELATION_H); | ||
242 | } else { | 239 | } else { |
243 | if (eval_load) | 240 | dbs_check_cpu(dbs_data, cpu); |
244 | dbs_check_cpu(dbs_data, cpu); | ||
245 | if (core_dbs_info->freq_lo) { | 241 | if (core_dbs_info->freq_lo) { |
246 | /* Setup timer for SUB_SAMPLE */ | 242 | /* Setup timer for SUB_SAMPLE */ |
247 | core_dbs_info->sample_type = OD_SUB_SAMPLE; | 243 | core_dbs_info->sample_type = OD_SUB_SAMPLE; |
248 | delay = core_dbs_info->freq_hi_jiffies; | 244 | delay = core_dbs_info->freq_hi_jiffies; |
249 | } else { | ||
250 | delay = delay_for_sampling_rate(od_tuners->sampling_rate | ||
251 | * core_dbs_info->rate_mult); | ||
252 | } | 245 | } |
253 | } | 246 | } |
254 | 247 | ||
248 | max_delay: | ||
249 | if (!delay) | ||
250 | delay = delay_for_sampling_rate(od_tuners->sampling_rate | ||
251 | * core_dbs_info->rate_mult); | ||
252 | |||
255 | schedule_delayed_work_on(smp_processor_id(), dw, delay); | 253 | schedule_delayed_work_on(smp_processor_id(), dw, delay); |
256 | mutex_unlock(&core_dbs_info->cdbs.timer_mutex); | 254 | mutex_unlock(&core_dbs_info->cdbs.timer_mutex); |
257 | } | 255 | } |