Subject: [PATCH 2.6.10-mm2] Fix idle with interrupts disabled (PPC)

From: [email-masked]
Date: Sun, 9 Jan 2005 13:22:11 +0100

The idle-thread-preemption-fix.patch in mm1/2 leads to a stalled box
on PPC machines which do not provide a powersave function and therefor
poll the idle loop with interrupts disabled. The patch reenables interrupts.

Signed-off-by: Thomas Gleixner <[email-masked]>

---
 idle.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
Index: 2.6.10-mm2/arch/ppc/kernel/idle.c
===================================================================
--- 2.6.10-mm2/arch/ppc/kernel/idle.c	(revision 141)
+++ 2.6.10-mm2/arch/ppc/kernel/idle.c	(working copy)
@@ -41,14 +41,17 @@
 	if (!need_resched()) {
 		if (powersave != NULL)
 			powersave();
+		else {
 #ifdef CONFIG_SMP
-		else {
 			set_thread_flag(TIF_POLLING_NRFLAG);
+			local_irq_enable();
 			while (!need_resched())
 				barrier();
 			clear_thread_flag(TIF_POLLING_NRFLAG);
+#else
+			local_irq_enable();
+#endif
 		}
-#endif
 	}
 	if (need_resched())
 		schedule();