From a3f8a97e4619a7cb90924781f0c5925967c35e88 Mon Sep 17 00:00:00 2001 From: Puja Gupta Date: Tue, 17 Apr 2018 11:44:32 -0700 Subject: [PATCH] sched/walt: Fix SCHED_CPUFREQ_CONTINUE for hotplug cases cluster->cpus might include hotplugged cores and as a result we would end up sending incorrect flag to cpufreq. Fix the bug by checking cpu_online_mask. Change-Id: I39fa9296aac72604c91470a8ffe0a5b9efbaac1f Signed-off-by: Puja Gupta --- kernel/sched/walt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/walt.c b/kernel/sched/walt.c index db90a4bd9313..746d3a2c1d83 100644 --- a/kernel/sched/walt.c +++ b/kernel/sched/walt.c @@ -3083,9 +3083,14 @@ void walt_irq_work(struct irq_work *irq_work) } for_each_sched_cluster(cluster) { - unsigned int num_cpus = cpumask_weight(&cluster->cpus), i = 1; + cpumask_t cluster_online_cpus; + unsigned int num_cpus, i = 1; - for_each_cpu(cpu, &cluster->cpus) { + cpumask_and(&cluster_online_cpus, &cluster->cpus, + cpu_online_mask); + num_cpus = cpumask_weight(&cluster_online_cpus); + + for_each_cpu(cpu, &cluster_online_cpus) { if (i == num_cpus) cpufreq_update_util(cpu_rq(cpu), flag); else