diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 216ea442b835..43d89f6af206 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -34,14 +34,6 @@ static struct od_ops od_ops; | |||
34 | 34 | ||
35 | static unsigned int default_powersave_bias; | 35 | static unsigned int default_powersave_bias; |
36 | 36 | ||
37 | static void ondemand_powersave_bias_init_cpu(int cpu) | ||
38 | { | ||
39 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); | ||
40 | |||
41 | dbs_info->freq_table = cpufreq_frequency_get_table(cpu); | ||
42 | dbs_info->freq_lo = 0; | ||
43 | } | ||
44 | |||
45 | /* | 37 | /* |
46 | * Not all CPUs want IO time to be accounted as busy; this depends on how | 38 | * Not all CPUs want IO time to be accounted as busy; this depends on how |
47 | * efficient idling at a higher frequency/voltage is. | 39 | * efficient idling at a higher frequency/voltage is. |
@@ -120,12 +112,13 @@ static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy, | |||
120 | return freq_hi; | 112 | return freq_hi; |
121 | } | 113 | } |
122 | 114 | ||
123 | static void ondemand_powersave_bias_init(void) | 115 | static void ondemand_powersave_bias_init(struct cpufreq_policy *policy) |
124 | { | 116 | { |
125 | int i; | 117 | unsigned int cpu = policy->cpu; |
126 | for_each_online_cpu(i) { | 118 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); |
127 | ondemand_powersave_bias_init_cpu(i); | 119 | |
128 | } | 120 | dbs_info->freq_table = cpufreq_frequency_get_table(cpu); |
121 | dbs_info->freq_lo = 0; | ||
129 | } | 122 | } |
130 | 123 | ||
131 | static void dbs_freq_increase(struct cpufreq_policy *policy, unsigned int freq) | 124 | static void dbs_freq_increase(struct cpufreq_policy *policy, unsigned int freq) |
@@ -306,6 +299,7 @@ static ssize_t store_powersave_bias(struct dbs_data *dbs_data, const char *buf, | |||
306 | size_t count) | 299 | size_t count) |
307 | { | 300 | { |
308 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; | 301 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; |
302 | struct policy_dbs_info *policy_dbs; | ||
309 | unsigned int input; | 303 | unsigned int input; |
310 | int ret; | 304 | int ret; |
311 | ret = sscanf(buf, "%u", &input); | 305 | ret = sscanf(buf, "%u", &input); |
@@ -317,7 +311,10 @@ static ssize_t store_powersave_bias(struct dbs_data *dbs_data, const char *buf, | |||
317 | input = 1000; | 311 | input = 1000; |
318 | 312 | ||
319 | od_tuners->powersave_bias = input; | 313 | od_tuners->powersave_bias = input; |
320 | ondemand_powersave_bias_init(); | 314 | |
315 | list_for_each_entry(policy_dbs, &dbs_data->policy_dbs_list, list) | ||
316 | ondemand_powersave_bias_init(policy_dbs->policy); | ||
317 | |||
321 | return count; | 318 | return count; |
322 | } | 319 | } |
323 | 320 | ||
@@ -398,11 +395,10 @@ static void od_exit(struct dbs_data *dbs_data, bool notify) | |||
398 | 395 | ||
399 | static void od_start(struct cpufreq_policy *policy) | 396 | static void od_start(struct cpufreq_policy *policy) |
400 | { | 397 | { |
401 | unsigned int cpu = policy->cpu; | 398 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu); |
402 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); | ||
403 | 399 | ||
404 | dbs_info->sample_type = OD_NORMAL_SAMPLE; | 400 | dbs_info->sample_type = OD_NORMAL_SAMPLE; |
405 | ondemand_powersave_bias_init_cpu(cpu); | 401 | ondemand_powersave_bias_init(policy); |
406 | } | 402 | } |
407 | 403 | ||
408 | define_get_cpu_dbs_routines(od_cpu_dbs_info); | 404 | define_get_cpu_dbs_routines(od_cpu_dbs_info); |