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 <asathyak@codeaurora.org>
This commit is contained in:
Archana Sathyakumar 2016-04-13 11:16:26 -06:00 committed by Kyle Yan
parent b2a2802cd5
commit f668e1e3d0

View file

@ -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 * 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 * 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_activity_info *node;
struct cpu_static_info *sp, *clear_sp; struct cpu_static_info *sp, *clear_sp;
int cpumask, cluster, mpidr; int cpumask, cluster, mpidr;
bool pdata_valid[NR_CPUS] = {0};
get_user(cpumask, &argp->cpumask); get_user(cpumask, &argp->cpumask);
get_user(cluster, &argp->cluster); 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); cpu_stats[cpu].ptable = per_cpu(ptable, cpu);
repopulate_stats(cpu); repopulate_stats(cpu);
pdata_valid[cpu] = true;
blocking_notifier_call_chain(
&msm_core_stats_notifier_list, cpu, NULL);
} }
} }
spin_unlock(&update_lock); 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; activate_power_table = true;
return 0; return 0;