MIPS: Allow kernel use of LL/SC to be separate from the presence of LL/SC.
authorDavid Daney <ddaney@caviumnetworks.com>
Mon, 13 Jul 2009 18:15:19 +0000 (11:15 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 17 Sep 2009 18:07:50 +0000 (20:07 +0200)
commitb791d1193af9772040e592d5aa161790f800b762
tree6adad3d9cdf278a3a1a3418ae75a2864d0cc7f39
parentf7ade3c168e4f437c11f57be012992bbb0e3075c
MIPS: Allow kernel use of LL/SC to be separate from the presence of LL/SC.

On some CPUs, it is more efficient to disable and enable interrupts in the
kernel rather than use ll/sc for atomic operations.  But if we were to set
cpu_has_llsc to false, we would break the userspace futex interface (in
asm/futex.h).

We separate the two concepts, with a new predicate kernel_uses_llsc, that
lets us disable the kernel's use of ll/sc while still allowing the futex
code to use it.

Also there were a couple of cases in bitops.h where we were using ll/sc
unconditionally even if cpu_has_llsc were false.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/atomic.h
arch/mips/include/asm/bitops.h
arch/mips/include/asm/cmpxchg.h
arch/mips/include/asm/cpu-features.h
arch/mips/include/asm/local.h
arch/mips/include/asm/system.h