diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-02-01 00:42:58 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-01 19:29:31 -0500 |
commit | b394058f064848deac7a7cd6942b6521d7b3fe1d (patch) | |
tree | 2e6272ca452cf2d116f00a561344a4672f751063 /drivers/cpufreq/cpufreq_governor.c | |
parent | 4447266b842d27f77b017a59eb9dc38ad7b299f1 (diff) |
cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()
Currently, whenever governor->governor() is called for CPUFRREQ_GOV_START event
we reset few tunables of governor. Which isn't correct, as this routine is
called for every cpu hot-[un]plugging event. We should actually be resetting
these only when the governor module is removed and re-installed.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_governor.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_governor.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 7aaa9b151940..79795c4bf611 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c | |||
@@ -254,11 +254,6 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data, | |||
254 | return rc; | 254 | return rc; |
255 | } | 255 | } |
256 | 256 | ||
257 | /* policy latency is in nS. Convert it to uS first */ | ||
258 | latency = policy->cpuinfo.transition_latency / 1000; | ||
259 | if (latency == 0) | ||
260 | latency = 1; | ||
261 | |||
262 | /* | 257 | /* |
263 | * conservative does not implement micro like ondemand | 258 | * conservative does not implement micro like ondemand |
264 | * governor, thus we are bound to jiffes/HZ | 259 | * governor, thus we are bound to jiffes/HZ |
@@ -270,20 +265,33 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data, | |||
270 | cpufreq_register_notifier(cs_ops->notifier_block, | 265 | cpufreq_register_notifier(cs_ops->notifier_block, |
271 | CPUFREQ_TRANSITION_NOTIFIER); | 266 | CPUFREQ_TRANSITION_NOTIFIER); |
272 | 267 | ||
273 | dbs_data->min_sampling_rate = MIN_SAMPLING_RATE_RATIO * | 268 | if (!policy->governor->initialized) |
274 | jiffies_to_usecs(10); | 269 | dbs_data->min_sampling_rate = |
270 | MIN_SAMPLING_RATE_RATIO * | ||
271 | jiffies_to_usecs(10); | ||
275 | } else { | 272 | } else { |
276 | od_dbs_info->rate_mult = 1; | 273 | od_dbs_info->rate_mult = 1; |
277 | od_dbs_info->sample_type = OD_NORMAL_SAMPLE; | 274 | od_dbs_info->sample_type = OD_NORMAL_SAMPLE; |
278 | od_ops->powersave_bias_init_cpu(cpu); | 275 | od_ops->powersave_bias_init_cpu(cpu); |
279 | od_tuners->io_is_busy = od_ops->io_busy(); | 276 | |
277 | if (!policy->governor->initialized) | ||
278 | od_tuners->io_is_busy = od_ops->io_busy(); | ||
280 | } | 279 | } |
281 | 280 | ||
281 | if (policy->governor->initialized) | ||
282 | goto unlock; | ||
283 | |||
284 | /* policy latency is in nS. Convert it to uS first */ | ||
285 | latency = policy->cpuinfo.transition_latency / 1000; | ||
286 | if (latency == 0) | ||
287 | latency = 1; | ||
288 | |||
282 | /* Bring kernel and HW constraints together */ | 289 | /* Bring kernel and HW constraints together */ |
283 | dbs_data->min_sampling_rate = max(dbs_data->min_sampling_rate, | 290 | dbs_data->min_sampling_rate = max(dbs_data->min_sampling_rate, |
284 | MIN_LATENCY_MULTIPLIER * latency); | 291 | MIN_LATENCY_MULTIPLIER * latency); |
285 | *sampling_rate = max(dbs_data->min_sampling_rate, latency * | 292 | *sampling_rate = max(dbs_data->min_sampling_rate, latency * |
286 | LATENCY_MULTIPLIER); | 293 | LATENCY_MULTIPLIER); |
294 | unlock: | ||
287 | mutex_unlock(&dbs_data->mutex); | 295 | mutex_unlock(&dbs_data->mutex); |
288 | 296 | ||
289 | /* Initiate timer time stamp */ | 297 | /* Initiate timer time stamp */ |