From f668e1e3d038aec10b8e470e73ad934ae2c3b1c8 Mon Sep 17 00:00:00 2001 From: Archana Sathyakumar Date: Wed, 13 Apr 2016 11:16:26 -0600 Subject: [PATCH] power: qcom: Move power table notification outside of critical section Since the blocking chain notifiers can be called from process context, the notification must not be sent from within a critical section. Move the blocking notification outside the critical section. Change-Id: Ia5679310fc59f25643e7c8d572cc230d262c5937 Signed-off-by: Archana Sathyakumar --- drivers/power/qcom/msm-core.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/power/qcom/msm-core.c b/drivers/power/qcom/msm-core.c index daa842498d96..49ed2eb3e40f 100644 --- a/drivers/power/qcom/msm-core.c +++ b/drivers/power/qcom/msm-core.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -377,6 +377,7 @@ static int update_userspace_power(struct sched_params __user *argp) struct cpu_activity_info *node; struct cpu_static_info *sp, *clear_sp; int cpumask, cluster, mpidr; + bool pdata_valid[NR_CPUS] = {0}; get_user(cpumask, &argp->cpumask); get_user(cluster, &argp->cluster); @@ -448,13 +449,19 @@ static int update_userspace_power(struct sched_params __user *argp) } cpu_stats[cpu].ptable = per_cpu(ptable, cpu); repopulate_stats(cpu); - - blocking_notifier_call_chain( - &msm_core_stats_notifier_list, cpu, NULL); + pdata_valid[cpu] = true; } } spin_unlock(&update_lock); + for_each_possible_cpu(cpu) { + if (!pdata_valid[cpu]) + continue; + + blocking_notifier_call_chain( + &msm_core_stats_notifier_list, cpu, NULL); + } + activate_power_table = true; return 0;