]> git.baikalelectronics.ru Git - kernel.git/commit
Clear the exclusive monitor when returning from an exception
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Sep 2009 22:27:05 +0000 (23:27 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Sep 2009 22:30:11 +0000 (23:30 +0100)
commit4c16f1d70c0d92f976f4c9d7e8e9d2bbd1284715
tree6dbef78960ad7b83a76df064751275913583068c
parentf373101c6880145fe82f59c723add5adba6b2c35
Clear the exclusive monitor when returning from an exception

The patch adds a CLREX or dummy STREX to the exception return path. This
is needed because several atomic/locking operations use a pair of
LDREX/STREXEQ and the EQ condition may not always be satisfied. This
would leave the exclusive monitor status set and may cause problems with
atomic/locking operations in the interrupted code.

With this patch, the atomic_set() operation can be a simple STR
instruction (on SMP systems, the global exclusive monitor is cleared by
STR anyway). Clearing the exclusive monitor during context switch is no
longer needed as this is handled by the exception return path anyway.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Jamie Lokier <jamie@shareable.org>
arch/arm/include/asm/atomic.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-header.S