linux-uconsole/arch
Will Deacon 54d4d42b25 ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+
commit a76d7bd96d upstream.

The open-coded mutex implementation for ARMv6+ cores suffers from a
severe lack of barriers, so in the uncontended case we don't actually
protect any accesses performed during the critical section.

Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
code but optimised to remove a branch instruction, as the mutex fastpath
was previously inlined. Now that this is executed out-of-line, we can
reuse the atomic access code for the locking (in fact, we use the xchg
code as this produces shorter critical sections).

This patch uses the generic xchg based implementation for mutexes on
ARMv6+, which introduces barriers to the lock/unlock operations and also
has the benefit of removing a fair amount of inline assembly code.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reported-by: Shan Kang <kangshan0910@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-02 09:47:55 -07:00
..
alpha Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts 2012-10-02 09:47:25 -07:00
arm ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+ 2012-10-02 09:47:55 -07:00
avr32 avr32: select generic atomic64_t support 2012-03-12 10:32:57 -07:00
blackfin rtc: fix build warnings in defconfigs 2011-06-15 20:04:02 -07:00
cris cris: add missing declaration of kgdb_init() and breakpoint() 2011-08-15 18:31:32 -07:00
frv Merge branch 'setns' 2011-05-28 10:51:01 -07:00
h8300 Merge branch 'setns' 2011-05-28 10:51:01 -07:00
ia64 random: remove rand_initialize_irq() 2012-08-15 12:04:28 -07:00
m32r Fix node_start/end_pfn() definition for mm/page_cgroup.c 2011-06-27 14:13:09 -07:00
m68k m68k: Correct the Atari ALLOWINT definition 2012-08-09 08:27:53 -07:00
microblaze Merge branch 'setns' 2011-05-28 10:51:01 -07:00
mips MIPS: Properly align the .data..init_task section. 2012-08-01 12:26:54 -07:00
mn10300 MN10300: asm/uaccess.h needs to #include linux/kernel.h for might_sleep() 2011-06-21 18:31:44 -07:00
parisc PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts 2012-09-14 10:00:51 -07:00
powerpc powerpc: Restore correct DSCR in context switch 2012-09-14 10:00:49 -07:00
s390 s390/compat: fix mmap compat system calls 2012-08-26 15:12:10 -07:00
score score: fix off-by-one index into syscall table 2012-01-25 17:25:04 -08:00
sh oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue 2012-01-06 14:13:57 -08:00
sparc KEYS: Use the compat keyctl() syscall wrapper on Sparc64 for Sparc32 compat 2012-06-01 15:12:54 +08:00
tile tile: fix bug where fls(0) was not returning 0 2012-06-01 15:13:00 +08:00
um um: Implement a custom pte_same() function 2012-06-01 15:12:55 +08:00
unicore32 unicore32: using generic-y format for one line asm-generic files 2011-06-09 16:29:52 +08:00
x86 MCE: Fix vm86 handling for 32bit mce handler 2012-10-02 09:47:55 -07:00
xtensa xtensa: prevent arbitrary read in ptrace 2011-08-04 21:58:39 -07:00
.gitignore
Kconfig mm, powerpc: move the RCU page-table freeing into generic code 2011-05-25 08:39:16 -07:00