[PATCH v6.6-RT] powerpc: Allow scheduling of IRQ with PREEMPT_RT.

Sebastian Andrzej Siewior <[email protected]> Thu, 9 Jan 2025 13:00:56 +0100
Newsgroups org.kernel.vger.stable-rt
Message-ID <[email protected]>
With the LAZY_PREEMPT patches, PowerPC core code was modified to allow
scheduling on return to user land from interrupt based on
CONFIG_PREEMPTION. With the removal of LAZY_PREEMPT the code reverted to
its original state. The switch to PREEMPT_AUTO did not cover PowerPC so
this change was lost.

Not being able to immediately schedule on return from interrupt can lead
to large latency spikes but also hang on boot on a e300 based platform
as reported by Robert Joslyn.

Check for schedule() based on CONFIG_PREEMPTION.

Fixes: b33022a48c797 ("sched: Replace LAZY_PREEMPT with PREEMPT_AUTO")
Signed-off-by: Robert Joslyn <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---

Clark, could you please stuff this into the v6.6 release after next?

 arch/powerpc/kernel/interrupt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index c4f6d3c69ba9d..1370612b27e0b 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -395,7 +395,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
 		/* Returning to a kernel context with local irqs enabled. */
 		WARN_ON_ONCE(!(regs->msr & MSR_EE));
 again:
-		if (IS_ENABLED(CONFIG_PREEMPT)) {
+		if (IS_ENABLED(CONFIG_PREEMPTION)) {
 			/* Return to preemptible kernel context */
 			if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
 				if (preempt_count() == 0)
-- 
2.47.1