]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerJiri Slaby <jslaby@suse.cz>
Wed, 19 Nov 2014 11:32:56 +0000 (12:32 +0100)
commit1c854a6cd16b5096200fb47d1418b1d20f7df6bd
treeb393c5dd33e7b21a0f854854ae0f5cdbf8249036
parenta80e35d99a6e184732ab484efd89af2b06f9e174
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: Jiri Slaby <jslaby@suse.cz>
arch/sparc/include/asm/atomic_32.h
arch/sparc/include/asm/cmpxchg_32.h
arch/sparc/lib/atomic32.c