Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 553b785b authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

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: default avatarRuchi Kandoi <kandoiruchi@google.com>
parent 4b254ff5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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);