diff options
| author | Ruchi Kandoi <kandoiruchi@google.com> | 2015-06-05 18:21:56 -0700 |
|---|---|---|
| committer | Arvin Quilao <arquilao@gmail.com> | 2017-04-21 02:24:57 +0000 |
| commit | a6730429da24106a40e9be24ac2cd61549d9ce9f (patch) | |
| tree | 62f0818d75a41aa7bb04a3c0e421d12725359413 /drivers/cpufreq | |
| parent | fc2eabb66dabd1bbfe61c16cf835df42b9936f27 (diff) | |
For architectures which support a single policy for multiple cpus,
powerstats will not be initalized for all the cores. This change will
make sure powerstats is initialized for all the cores.
Also minor changes to increase code readability.
Bug: 21498425
Change-Id: I938f45e92ff6d5371c32c4d0e37274e6de66769c
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
(cherry picked from commit 5862c50d1970886b5b5a57b5b52ecfd6feb95ebd)
Diffstat (limited to 'drivers/cpufreq')
| -rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index a56f59b03d6..67b9fc7b9ba 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -610,11 +610,10 @@ static int cpufreq_stat_notifier_policy(struct notifier_block *nb, count++; } - if (!per_cpu(all_cpufreq_stats, cpu)) - cpufreq_allstats_create(cpu, table, count); - - if (!per_cpu(cpufreq_power_stats, cpu)) - cpufreq_powerstats_create(cpu, table, count); + for_each_possible_cpu(cpu_num) { + if (!per_cpu(cpufreq_power_stats, cpu_num)) + cpufreq_powerstats_create(cpu_num, table, count); + } if (val == CPUFREQ_CREATE_POLICY) ret = __cpufreq_stats_create_table(policy, table, count); |
