Skip to contentSkip to conversation

MIPS: Alchemy: fix wait function

PATCH Superseded Manuel Lauss 1 participant 1 message May 23, 2013 MIPS

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Alchemy: fix wait function

Only an interrupt can wake the core from 'wait', enable interrupts locally before executing 'wait'.

---
Please add to the 3.10 queue, fixes a rather boring hang on boot.

 arch/mips/kernel/idle.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/mips/kernel/idle.c +4 -4
index 3b09b88..6da2c0f 100644
@@ -93,12 +93,13 @@ static void rm7k_wait_irqoff(void)
 }
 
 /*
- * The Au1xxx wait is available only if using 32khz counter or
- * external timer source, but specifically not CP0 Counter.
- * alchemy/common/time.c may override cpu_wait!
+ * Au1 'wait' is only useful when the 32kHz counter is used as timer,
+ * since coreclock (and the cp0 counter) stops upon executing it. Only an
+ * interrupt can wake it, so they must be enabled before entering idle modes.
  */
 static void au1k_wait(void)
 {
+	local_irq_enable();
 	__asm__(
 	"	.set	mips3			\n"
 	"	cache	0x14, 0(%0)		\n"
@@ -112,7 +113,6 @@ static void au1k_wait(void)
 	"	nop				\n"
 	"	.set	mips0			\n"
 	: : "r" (au1k_wait));
-	local_irq_enable();
 }
 
 static int __initdata nowait;
Signature · 1 line
1.8.2.1