From 951ffacded2b9b2b48849ecc4f17d42eb738591c Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Tue, 26 Apr 2022 11:16:32 -0700 Subject: [PATCH] sched/walt: Ensure one 32bit capable cpu is never halted It is possible that all 32bit cpus are halted. In this case a 32 bit task can be woken, and the scheduler will not find a cpu for it to run on that is 32 bit capable. Prevent the least-significant 32bit capable cpu from ever being halted. Change-Id: I23f616a5988d7a7eaa6b0d7dd7ef82dbe6f5ec9b Signed-off-by: Stephen Dickey --- kernel/sched/walt/walt_halt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/walt/walt_halt.c b/kernel/sched/walt/walt_halt.c index b91c1d6d28c7..f32ca51d3dff 100644 --- a/kernel/sched/walt/walt_halt.c +++ b/kernel/sched/walt/walt_halt.c @@ -271,6 +271,11 @@ static int halt_cpus(struct cpumask *cpus) for_each_cpu(cpu, cpus) { + if (cpu == cpumask_first(system_32bit_el0_cpumask())) { + ret = -EINVAL; + goto out; + } + halt_cpu_state = per_cpu_ptr(&halt_state, cpu); /* set the cpu as halted */ @@ -290,6 +295,7 @@ static int halt_cpus(struct cpumask *cpus) if (!IS_ERR(walt_drain_thread)) wake_up_process(walt_drain_thread); +out: trace_halt_cpus(cpus, start_time, 1, ret); return ret;