[ARM SMP] Clear the exclusive monitor on ARMv6 CPUs on context switch
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Wed, 10 Aug 2005 13:52:52 +0000 (14:52 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 10 Aug 2005 13:52:52 +0000 (14:52 +0100)
Ensure that the exclusive monitor is cleared on context switch with
ARMv6 CPUs.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/entry-armv.S

index 39a6c1b0b9a32db8f578bab2d9f4156acc5d4054..7152bfbee581ea4fa83769bd323564a6249782f7 100644 (file)
@@ -533,6 +533,13 @@ ENTRY(__switch_to)
        ldr     r3, [r2, #TI_TP_VALUE]
        stmia   ip!, {r4 - sl, fp, sp, lr}      @ Store most regs on stack
        ldr     r6, [r2, #TI_CPU_DOMAIN]!
+#if __LINUX_ARM_ARCH__ >= 6
+#ifdef CONFIG_CPU_MPCORE
+       clrex
+#else
+       strex   r3, r4, [ip]                    @ Clear exclusive monitor
+#endif
+#endif
 #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
        mra     r4, r5, acc0
        stmia   ip, {r4, r5}