[PATCH] MIPS: Enable interrupts in arch_cpu_idle()

From: Thomas Gleixner
Date: Thu May 02 2013 - 10:33:59 EST


commit cdbedc61c8 (mips: Use generic idle loop) broke MIPS as I did
not realize that MIPS wants to invoke the wait instructions with
interrupts enabled. Don't ask why that works correctly; Ralf suggested
to get thoroughly drunk before even thinking about it. Looking sober
at commit c65a5480 ([MIPS] Fix potential latency problem due to
non-atomic cpu_wait) is not recommended.

Enable interrupts in arch_cpu_idle() on mips to repair the issue.

Reported-and-tested-by: Jonas Gorski <jogo@xxxxxxxxxxx>
Reported-by: EunBong Song <eunb.song@xxxxxxxxxxx>
Booze-recommended-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Index: linux-2.6/arch/mips/kernel/process.c
===================================================================
--- linux-2.6.orig/arch/mips/kernel/process.c
+++ linux-2.6/arch/mips/kernel/process.c
@@ -50,13 +50,18 @@ void arch_cpu_idle_dead(void)
}
#endif

-void arch_cpu_idle(void)
+static void smtc_idle_hook(void)
{
#ifdef CONFIG_MIPS_MT_SMTC
extern void smtc_idle_loop_hook(void);
-
smtc_idle_loop_hook();
#endif
+}
+
+void arch_cpu_idle(void)
+{
+ local_irq_enable();
+ smtc_idle_hook();
if (cpu_wait)
(*cpu_wait)();
else
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/