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

Commit 509cb3b7 authored by Anji Jonnala's avatar Anji Jonnala
Browse files

msm: rq_stats: update related_cpus in the cpu_load runtime



"related_cpu" indicates the list of CPUs that need some
sort of frequency coordination, whether software or hardware.
ex:- if all cpus shares the same clock, all 4 cpus belongs to
related_cpus.

cpufreq driver updates the related_cpus during hotplug offline/online
events. Hence update related_cpus for all cpus during hotplug notifier.

CRs-fixed: 548631
Change-Id: I6543ddaeebf73d18334066b090ee7c4a72466e4a
Signed-off-by: default avatarAnji Jonnala <anjir@codeaurora.org>
parent 759f5a97
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -190,6 +190,18 @@ static int cpufreq_transition_handler(struct notifier_block *nb,
	return 0;
}

static void update_related_cpus(void)
{
	unsigned cpu;

	for_each_cpu(cpu, cpu_online_mask) {
		struct cpu_load_data *this_cpu = &per_cpu(cpuload, cpu);
		struct cpufreq_policy cpu_policy;

		cpufreq_get_policy(&cpu_policy, cpu);
		cpumask_copy(this_cpu->related_cpus, cpu_policy.cpus);
	}
}
static int cpu_hotplug_handler(struct notifier_block *nb,
			unsigned long val, void *data)
{
@@ -200,6 +212,7 @@ static int cpu_hotplug_handler(struct notifier_block *nb,
	case CPU_ONLINE:
		if (!this_cpu->cur_freq)
			this_cpu->cur_freq = acpuclk_get_rate(cpu);
		update_related_cpus();
	case CPU_ONLINE_FROZEN:
		this_cpu->avg_load_maxfreq = 0;
	}