Subject: [PATCH] fix local_irq_save()/local_irq_restore() when CONFIG_CPU_MIPSR2 & CONFIG_IRQ_CPU

From: Maxime Bizon <[email-masked]>
Date: Tue, 20 Dec 2005 06:32:19 +0100

Hello all,

I was unable to get my R4KECr2 board working with CONFIG_CPU_MIPSR2 &
CONFIG_IRQ_CPU, irq delivery is not working.

local_irq_restore() logic is to check that "flags" is non zero, and
enable irq accordingly.

But "flags" comes directly from di, which according to mips instruction
set, saves whole status content, not just IE bit.

Attached patch to fix this.

Signed-off-by: Maxime Bizon <[email-masked]>

--- linux.git/include/asm-mips/interrupt.h.old	2005-12-20 06:20:44.000000000 +0100
+++ linux.git/include/asm-mips/interrupt.h	2005-12-20 06:21:02.000000000 +0100
@@ -93,6 +93,7 @@
 	"	.set	noat						\n"
 #ifdef CONFIG_CPU_MIPSR2
 	"	di	\\result					\n"
+	"	andi	\\result, 1					\n"
 #else
 	"	mfc0	\\result, $12					\n"
 	"	ori	$1, \\result, 1					\n"

Thanks,

-- 
Maxime

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 20 Dec 2005 12:00:05 +0000 (GMT)

> Attached patch to fix this.

 Or alternatively something like this: 
"http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=Pine.LNX.4.61L.0507121626370.14155%40blysk.ds.pg.gda.pl", 
for consistency with the other variants.  It looks like we are the only 
two who care...

  Maciej

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 22 Dec 2005 02:48:10 +0100

> set, saves whole status content, not just IE bit.

There are less local_irq_save than local_irq_restore calls, so is the
preferable place for the fix.  Applied,

  Ralf