diff options
author | Ruchi Kandoi <kandoiruchi@google.com> | 2015-06-05 18:21:56 -0700 |
---|---|---|
committer | Ruchi Kandoi <kandoiruchi@google.com> | 2015-06-08 11:14:02 -0700 |
commit | 553b785b53837e183cc831d08c11ab6e1f20ae6b (patch) | |
tree | 9aa445f681549e294a527469fdd3278457d61907 | |
parent | 4b254ff54bf9dc95597c0a6b1845db42c81735af (diff) |
cpufreq: Iterate over all the possible cpus to create powerstats.
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.
Bug: 21498425
Change-Id: I938f45e92ff6d5371c32c4d0e37274e6de66769c
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 83030cc4bd33..a65b6bd09b3f 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -596,7 +596,7 @@ static int cpufreq_stat_notifier_policy(struct notifier_block *nb, int ret = 0, count = 0; struct cpufreq_policy *policy = data; struct cpufreq_frequency_table *table, *pos; - unsigned int cpu = policy->cpu; + unsigned int cpu_num, cpu = policy->cpu; if (val == CPUFREQ_UPDATE_POLICY_CPU) { cpufreq_stats_update_policy_cpu(policy); @@ -613,8 +613,10 @@ static int cpufreq_stat_notifier_policy(struct notifier_block *nb, 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); |