kernel: generic: add 3.10-rc1 support
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.10 / 003-MIPS-Enable-interrupts-in-arch_cpu_idle.patch
1 From 4fec4a2d70efa390268d1098bd4b008dda0e399e Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Thu, 2 May 2013 13:33:52 +0000
4 Subject: [PATCH 3/3] MIPS: Enable interrupts in arch_cpu_idle()
5
6 commit cdbedc61c8 (mips: Use generic idle loop) broke MIPS as I did
7 not realize that MIPS wants to invoke the wait instructions with
8 interrupts enabled. Don't ask why that works correctly; Ralf suggested
9 to get thoroughly drunk before even thinking about it. Looking sober
10 at commit c65a5480 ([MIPS] Fix potential latency problem due to
11 non-atomic cpu_wait) is not recommended.
12
13 Enable interrupts in arch_cpu_idle() on mips to repair the issue.
14
15 Reported-and-tested-by: Jonas Gorski <jogo@openwrt.org>
16 Reported-by: EunBong Song <eunb.song@samsung.com>
17 Booze-recommended-by: Ralf Baechle <ralf@linux-mips.org>
18 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
19 ---
20 arch/mips/kernel/process.c | 9 +++++++--
21 1 file changed, 7 insertions(+), 2 deletions(-)
22
23 --- a/arch/mips/kernel/process.c
24 +++ b/arch/mips/kernel/process.c
25 @@ -51,13 +51,18 @@ void arch_cpu_idle_dead(void)
26 }
27 #endif
28
29 -void arch_cpu_idle(void)
30 +static void smtc_idle_hook(void)
31 {
32 #ifdef CONFIG_MIPS_MT_SMTC
33 extern void smtc_idle_loop_hook(void);
34 -
35 smtc_idle_loop_hook();
36 #endif
37 +}
38 +
39 +void arch_cpu_idle(void)
40 +{
41 + local_irq_enable();
42 + smtc_idle_hook();
43 if (cpu_wait)
44 (*cpu_wait)();
45 else