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.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 64ef737e7e72..4fd0006b1291 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -25,7 +25,7 @@
25 25
26#include "cpufreq_governor.h" 26#include "cpufreq_governor.h"
27 27
28/* Conservative governor macors */ 28/* Conservative governor macros */
29#define DEF_FREQUENCY_UP_THRESHOLD (80) 29#define DEF_FREQUENCY_UP_THRESHOLD (80)
30#define DEF_FREQUENCY_DOWN_THRESHOLD (20) 30#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
31#define DEF_SAMPLING_DOWN_FACTOR (1) 31#define DEF_SAMPLING_DOWN_FACTOR (1)
@@ -113,17 +113,20 @@ static void cs_check_cpu(int cpu, unsigned int load)
113 113
114static void cs_dbs_timer(struct work_struct *work) 114static void cs_dbs_timer(struct work_struct *work)
115{ 115{
116 struct delayed_work *dw = to_delayed_work(work);
116 struct cs_cpu_dbs_info_s *dbs_info = container_of(work, 117 struct cs_cpu_dbs_info_s *dbs_info = container_of(work,
117 struct cs_cpu_dbs_info_s, cdbs.work.work); 118 struct cs_cpu_dbs_info_s, cdbs.work.work);
118 unsigned int cpu = dbs_info->cdbs.cpu; 119 unsigned int cpu = dbs_info->cdbs.cur_policy->cpu;
120 struct cs_cpu_dbs_info_s *core_dbs_info = &per_cpu(cs_cpu_dbs_info,
121 cpu);
119 int delay = delay_for_sampling_rate(cs_tuners.sampling_rate); 122 int delay = delay_for_sampling_rate(cs_tuners.sampling_rate);
120 123
121 mutex_lock(&dbs_info->cdbs.timer_mutex); 124 mutex_lock(&core_dbs_info->cdbs.timer_mutex);
125 if (need_load_eval(&core_dbs_info->cdbs, cs_tuners.sampling_rate))
126 dbs_check_cpu(&cs_dbs_data, cpu);
122 127
123 dbs_check_cpu(&cs_dbs_data, cpu); 128 schedule_delayed_work_on(smp_processor_id(), dw, delay);
124 129 mutex_unlock(&core_dbs_info->cdbs.timer_mutex);
125 schedule_delayed_work_on(cpu, &dbs_info->cdbs.work, delay);
126 mutex_unlock(&dbs_info->cdbs.timer_mutex);
127} 130}
128 131
129static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 132static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
@@ -141,7 +144,7 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
141 144
142 /* 145 /*
143 * we only care if our internally tracked freq moves outside the 'valid' 146 * we only care if our internally tracked freq moves outside the 'valid'
144 * ranges of freqency available to us otherwise we do not change it 147 * ranges of frequency available to us otherwise we do not change it
145 */ 148 */
146 if (dbs_info->requested_freq > policy->max 149 if (dbs_info->requested_freq > policy->max
147 || dbs_info->requested_freq < policy->min) 150 || dbs_info->requested_freq < policy->min)