diff options
author | Kishor PK <kpbhat@codeaurora.org> | 2018-05-10 16:04:55 +0530 |
---|---|---|
committer | Shirle Yuen <shirleyshukyee@google.com> | 2018-08-05 16:39:18 -0700 |
commit | 7f018eb950e5e6afc54c792150bc6bf5190f67bb (patch) | |
tree | cb9720f4015da229aa2bda4ab92db9c846f4a808 | |
parent | d01e45b1c71449c3064ac0c828fdf00527ea34e0 (diff) | |
download | qcom-msm8x09-v3.10-7f018eb950e5e6afc54c792150bc6bf5190f67bb.tar.gz |
msm-core: Add spinlock for update lock
Ensure spin lock and unlock are added for update lock.
Bug: 111289931
Change-Id: Ica1ccb639c900295ffc29a94d1094a19bfa43755
Signed-off-by: Kishor PK <kpbhat@codeaurora.org>
(cherry picked from commit 1dd16feaec13e845e5c6026e3a582d223ce2cb63)
-rw-r--r-- | drivers/power/qcom/msm-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/qcom/msm-core.c b/drivers/power/qcom/msm-core.c index 109a567e972..662b065838c 100644 --- a/drivers/power/qcom/msm-core.c +++ b/drivers/power/qcom/msm-core.c @@ -96,6 +96,7 @@ struct cpu_static_info { static DEFINE_MUTEX(policy_update_mutex); static DEFINE_MUTEX(kthread_update_mutex); +static DEFINE_SPINLOCK(update_lock); static struct delayed_work sampling_work; static struct completion sampling_completion; static struct task_struct *sampling_task; @@ -194,7 +195,6 @@ void trigger_cpu_pwr_stats_calc(void) { int cpu; static long prev_temp[NR_CPUS]; - static DEFINE_SPINLOCK(update_lock); struct cpu_activity_info *cpu_node; if (disabled) @@ -363,8 +363,8 @@ static int update_userspace_power(struct sched_params __user *argp) /* Copy the same power values for all the cpus in the cpumask * argp->cpumask within the cluster (argp->cluster) */ - spin_lock(&update_lock); get_user(cpumask, &argp->cpumask); + spin_lock(&update_lock); for (i = 0; i < MAX_CORES_PER_CLUSTER; i++, cpumask >>= 1) { if (!(cpumask & 0x01)) continue; @@ -386,8 +386,8 @@ static int update_userspace_power(struct sched_params __user *argp) repopulate_stats(cpu); } } + spin_unlock(&update_lock); mutex_unlock(&policy_update_mutex); - activate_power_table = true; return 0; |