diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2013-06-13 15:27:26 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2013-06-13 15:27:25 -0700 |
commit | bee9cc563f9ff034dca5b2184cbfc2f1195a9dbd (patch) | |
tree | 2b1507caad76f96bef8751f314cbf98c6af4b19a | |
parent | c8b01b0afcd291d04892b39dc10729bea6970755 (diff) | |
parent | a7ceddd0cef571857349e7452010f7aeeaadf59b (diff) |
Merge "cpufreq: ondemand: Fix locking in store_powersave_bias"M8974AAAAANLYA31050108
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 7 |
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; } |