aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-03-13 14:00:35 -0400
committerIngo Molnar <mingo@kernel.org>2014-04-18 08:20:47 -0400
commit09a01c0ccb1837abb28afcfdd668fa0dfabed928 (patch)
tree7ef2ffee4fbfe1b07f88d660b46dad4fef80a05e /arch/xtensa
parentd00a569284b1340c16fe2c148099e077ea09ebc9 (diff)
arch,xtensa: Convert smp_mb__*()
Xtensa SMP has compare-and-swap which is fully serializing, therefore its exising smp_mb__{before,after}_clear_bit() appear unduly heavy. Implement the new barriers as barrier(). Signed-off-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/n/tip-e9rqjxr1m1ejsob9p433kmji@git.kernel.org Cc: Chris Zankel <chris@zankel.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/include/asm/atomic.h7
-rw-r--r--arch/xtensa/include/asm/barrier.h3
-rw-r--r--arch/xtensa/include/asm/bitops.h4
3 files changed, 5 insertions, 9 deletions
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index e7fb447bce8e..e5103b47a8ce 100644
--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -19,6 +19,7 @@
19#ifdef __KERNEL__ 19#ifdef __KERNEL__
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/cmpxchg.h> 21#include <asm/cmpxchg.h>
22#include <asm/barrier.h>
22 23
23#define ATOMIC_INIT(i) { (i) } 24#define ATOMIC_INIT(i) { (i) }
24 25
@@ -387,12 +388,6 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
387#endif 388#endif
388} 389}
389 390
390/* Atomic operations are already serializing */
391#define smp_mb__before_atomic_dec() barrier()
392#define smp_mb__after_atomic_dec() barrier()
393#define smp_mb__before_atomic_inc() barrier()
394#define smp_mb__after_atomic_inc() barrier()
395
396#endif /* __KERNEL__ */ 391#endif /* __KERNEL__ */
397 392
398#endif /* _XTENSA_ATOMIC_H */ 393#endif /* _XTENSA_ATOMIC_H */
diff --git a/arch/xtensa/include/asm/barrier.h b/arch/xtensa/include/asm/barrier.h
index 0a24b04d6b21..5b88774c75ab 100644
--- a/arch/xtensa/include/asm/barrier.h
+++ b/arch/xtensa/include/asm/barrier.h
@@ -13,6 +13,9 @@
13#define rmb() barrier() 13#define rmb() barrier()
14#define wmb() mb() 14#define wmb() mb()
15 15
16#define smp_mb__before_atomic() barrier()
17#define smp_mb__after_atomic() barrier()
18
16#include <asm-generic/barrier.h> 19#include <asm-generic/barrier.h>
17 20
18#endif /* _XTENSA_SYSTEM_H */ 21#endif /* _XTENSA_SYSTEM_H */
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 7b6873ae84c2..3f44fa2a53e9 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -21,9 +21,7 @@
21 21
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/byteorder.h> 23#include <asm/byteorder.h>
24 24#include <asm/barrier.h>
25#define smp_mb__before_clear_bit() smp_mb()
26#define smp_mb__after_clear_bit() smp_mb()
27 25
28#include <asm-generic/bitops/non-atomic.h> 26#include <asm-generic/bitops/non-atomic.h>
29 27