From: Ralf Baechle Date: Tue, 21 May 2013 15:33:32 +0000 (+0200) Subject: MIPS: Idle: Break r4k_wait into two functions and fix it. X-Git-Tag: upstream/snapshot3+hdmi~5050^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=087d990b371c59edbfc119600e2d2eda18366292;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git MIPS: Idle: Break r4k_wait into two functions and fix it. local_irq_enable() may expand into very different code, so it rather should stay in C. Also this keeps the assembler code size constant which keeps the rollback code simple. So it's best to split r4k_wait into two parts, one C and one assembler. Finally add the local_irq_enable() to r4k_wait to ensure the WAIT instruction in __r4k_wait() will work properly. Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/include/asm/idle.h b/arch/mips/include/asm/idle.h index be6f807..d192158 100644 --- a/arch/mips/include/asm/idle.h +++ b/arch/mips/include/asm/idle.h @@ -4,7 +4,8 @@ #include extern void (*cpu_wait)(void); -extern asmlinkage void r4k_wait(void); +extern void r4k_wait(void); +extern asmlinkage void __r4k_wait(void); extern void r4k_wait_irqoff(void); extern void __pastwait(void); diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 9098829..31fa856 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -122,7 +122,7 @@ handle_vcei: __FINIT .align 5 /* 32 byte rollback region */ -LEAF(r4k_wait) +LEAF(__r4k_wait) .set push .set noreorder /* start of rollback region */ @@ -146,14 +146,14 @@ LEAF(r4k_wait) jr ra nop .set pop - END(r4k_wait) + END(__r4k_wait) .macro BUILD_ROLLBACK_PROLOGUE handler FEXPORT(rollback_\handler) .set push .set noat MFC0 k0, CP0_EPC - PTR_LA k1, r4k_wait + PTR_LA k1, __r4k_wait ori k0, 0x1f /* 32 byte rollback region */ xori k0, 0x1f bne k0, k1, 9f diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c index 985cc02..3b09b88 100644 --- a/arch/mips/kernel/idle.c +++ b/arch/mips/kernel/idle.c @@ -45,6 +45,12 @@ static void r39xx_wait(void) local_irq_enable(); } +void r4k_wait(void) +{ + local_irq_enable(); + __r4k_wait(); +} + /* * This variant is preferable as it allows testing need_resched and going to * sleep depending on the outcome atomically. Unfortunately the "It is