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 <quic_dickey@quicinc.com>
This commit is contained in:
Stephen Dickey 2022-04-26 11:16:32 -07:00 committed by Rishabh Bhatnagar
parent db2bf2acc0
commit 951ffacded

View File

@ -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;