aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-03-13 14:00:37 -0400
committerIngo Molnar <mingo@kernel.org>2014-04-18 05:40:34 -0400
commitb7bb7d9b28f6278625fbe7892b8c7799bb12a26a (patch)
treeea35d81cba393ba78f5a9ab5347bd249cfc5f4e7 /arch/blackfin
parent710adaa913169d7183cdf0de41c2a349101ff615 (diff)
arch,blackfin: Convert smp_mb__*()
Blackfin's atomic primitives do not imply a full barrier as whitnessed from its SMP smp_mb__{before,after}_clear_bit() implementations. However since !SMP smp_mb() reduces to barrier() remove everything and rely on the asm-generic/barrier.h implentation. 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-1widdkdsb3c1titq8jez6g3g@git.kernel.org Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Steven Miao <realmz6@gmail.com> Cc: adi-buildroot-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/include/asm/barrier.h3
-rw-r--r--arch/blackfin/include/asm/bitops.h14
2 files changed, 5 insertions, 12 deletions
diff --git a/arch/blackfin/include/asm/barrier.h b/arch/blackfin/include/asm/barrier.h
index 19283a16ac08..420006877998 100644
--- a/arch/blackfin/include/asm/barrier.h
+++ b/arch/blackfin/include/asm/barrier.h
@@ -27,6 +27,9 @@
27 27
28#endif /* !CONFIG_SMP */ 28#endif /* !CONFIG_SMP */
29 29
30#define smp_mb__before_atomic() barrier()
31#define smp_mb__after_atomic() barrier()
32
30#include <asm-generic/barrier.h> 33#include <asm-generic/barrier.h>
31 34
32#endif /* _BLACKFIN_BARRIER_H */ 35#endif /* _BLACKFIN_BARRIER_H */
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 0ca40dd44724..b298b654a26f 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -27,21 +27,17 @@
27 27
28#include <asm-generic/bitops/ext2-atomic.h> 28#include <asm-generic/bitops/ext2-atomic.h>
29 29
30#include <asm/barrier.h>
31
30#ifndef CONFIG_SMP 32#ifndef CONFIG_SMP
31#include <linux/irqflags.h> 33#include <linux/irqflags.h>
32
33/* 34/*
34 * clear_bit may not imply a memory barrier 35 * clear_bit may not imply a memory barrier
35 */ 36 */
36#ifndef smp_mb__before_clear_bit
37#define smp_mb__before_clear_bit() smp_mb()
38#define smp_mb__after_clear_bit() smp_mb()
39#endif
40#include <asm-generic/bitops/atomic.h> 37#include <asm-generic/bitops/atomic.h>
41#include <asm-generic/bitops/non-atomic.h> 38#include <asm-generic/bitops/non-atomic.h>
42#else 39#else
43 40
44#include <asm/barrier.h>
45#include <asm/byteorder.h> /* swab32 */ 41#include <asm/byteorder.h> /* swab32 */
46#include <linux/linkage.h> 42#include <linux/linkage.h>
47 43
@@ -101,12 +97,6 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
101 return __raw_bit_test_toggle_asm(a, nr & 0x1f); 97 return __raw_bit_test_toggle_asm(a, nr & 0x1f);
102} 98}
103 99
104/*
105 * clear_bit() doesn't provide any barrier for the compiler.
106 */
107#define smp_mb__before_clear_bit() barrier()
108#define smp_mb__after_clear_bit() barrier()
109
110#define test_bit __skip_test_bit 100#define test_bit __skip_test_bit
111#include <asm-generic/bitops/non-atomic.h> 101#include <asm-generic/bitops/non-atomic.h>
112#undef test_bit 102#undef test_bit