aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2013-06-13 15:27:26 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2013-06-13 15:27:25 -0700
commitbee9cc563f9ff034dca5b2184cbfc2f1195a9dbd (patch)
tree2b1507caad76f96bef8751f314cbf98c6af4b19a
parentc8b01b0afcd291d04892b39dc10729bea6970755 (diff)
parenta7ceddd0cef571857349e7452010f7aeeaadf59b (diff)
Merge "cpufreq: ondemand: Fix locking in store_powersave_bias"M8974AAAAANLYA31050108
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index a6cd941eb480..fda64e58574f 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -112,7 +112,7 @@ static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info);
static unsigned int dbs_enable; /* number of CPUs using this policy */
/*
- * dbs_mutex protects dbs_enable in governor start/stop.
+ * dbs_mutex protects dbs_enable and dbs_info during start/stop.
*/
static DEFINE_MUTEX(dbs_mutex);
@@ -585,7 +585,10 @@ static ssize_t store_powersave_bias(struct kobject *a, struct attribute *b,
POWERSAVE_BIAS_MINLEVEL));
dbs_tuners_ins.powersave_bias = input;
+
+ mutex_lock(&dbs_mutex);
get_online_cpus();
+
if (!bypass) {
if (reenable_timer) {
/* reinstate dbs timer */
@@ -652,7 +655,9 @@ skip_this_cpu_bypass:
unlock_policy_rwsem_write(cpu);
}
}
+
put_online_cpus();
+ mutex_unlock(&dbs_mutex);
return count;
}