From d014869ae8e5bead2b81fe7773c31a0d8f4c2359 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 4 Jun 2022 18:19:13 +0200 Subject: [PATCH] Revert "ANDROID: cpu: Don't prevent hotplug from DL/BATCH/IDLE" This reverts commit 9da1f37103d99b4ee850b89be3af089c9be43493. It causes merge problems with 5.19-rc1 and should no longer be needed at all. Bug: 169238689 Cc: Quentin Perret Signed-off-by: Greg Kroah-Hartman Change-Id: I27de2776905401b42c4e5cf2be784eae18f8816b --- kernel/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index be3d60418e12..e25053a0e4cc 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1333,8 +1333,10 @@ static int switch_to_rt_policy(void) if (policy == SCHED_NORMAL) /* Switch to SCHED_FIFO from SCHED_NORMAL. */ return sched_setscheduler_nocheck(current, SCHED_FIFO, ¶m); - else + else if (policy == SCHED_FIFO || policy == SCHED_RR) return 1; + else + return -EPERM; } static int switch_to_fair_policy(void) @@ -1430,6 +1432,8 @@ static int cpu_up(unsigned int cpu, enum cpuhp_state target) */ switch_err = switch_to_rt_policy(); + if (switch_err < 0) + return switch_err; err = try_online_node(cpu_to_node(cpu)); if (err)