sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks
authorAndreas Larsson <andreas@gaisler.com>
Wed, 5 Nov 2014 14:52:08 +0000 (15:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:00 +0000 (09:23 -0800)
commit882b3ba4a885d3bc458e09ad951b44047b3b27a7
treeb22184504edf43c0f7efbec70149b5893c570fcf
parentca9811bf3fc654c277e17061452e97b0144c8740
sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks

[ Upstream commit 1a17fdc4f4ed06b63fac1937470378a5441a663a ]

Atomicity between xchg and cmpxchg cannot be guaranteed when xchg is
implemented with a swap and cmpxchg is implemented with locks.
Without this, e.g. mcs_spin_lock and mcs_spin_unlock are broken.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/include/asm/atomic_32.h
arch/sparc/include/asm/cmpxchg_32.h
arch/sparc/lib/atomic32.c