arch,metag: Convert smp_mb__*()
authorPeter Zijlstra <peterz@infradead.org>
Thu, 13 Mar 2014 18:00:36 +0000 (19:00 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 18 Apr 2014 12:20:38 +0000 (14:20 +0200)
Implement the new barriers; as per the old versions the metag atomic
imply a full 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-dqnyo215kq38wi4xcxnbpjw3@git.kernel.org
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-metag@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/metag/include/asm/atomic.h
arch/metag/include/asm/barrier.h
arch/metag/include/asm/bitops.h

index 307ecd2bd9a171896c0db71b7d2124cd0e755c82..470e365f04ea4ee3f4503c060e8dacbd1e9dd0da 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <asm/cmpxchg.h>
+#include <asm/barrier.h>
 
 #if defined(CONFIG_METAG_ATOMICITY_IRQSOFF)
 /* The simple UP case. */
 
 #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
-#define smp_mb__before_atomic_dec()    barrier()
-#define smp_mb__after_atomic_dec()     barrier()
-#define smp_mb__before_atomic_inc()    barrier()
-#define smp_mb__after_atomic_inc()     barrier()
-
 #endif
 
 #define atomic_dec_if_positive(v)       atomic_sub_if_positive(1, v)
index 5d6b4b407ddab29b677a7aa5328715127dfdad56..d1768c6f5b18247f47358235ce57a4a864f08df3 100644 (file)
@@ -97,4 +97,7 @@ do {                                                                  \
        ___p1;                                                          \
 })
 
+#define smp_mb__before_atomic()        barrier()
+#define smp_mb__after_atomic() barrier()
+
 #endif /* _ASM_METAG_BARRIER_H */
index c0d0df0d13786a6439ac0df73543e1e1dc4e9db9..2671134ee74593bc89eceafaa15ae8b5f4bff12b 100644 (file)
@@ -5,12 +5,6 @@
 #include <asm/barrier.h>
 #include <asm/global_lock.h>
 
-/*
- * clear_bit() doesn't provide any barrier for the compiler.
- */
-#define smp_mb__before_clear_bit()     barrier()
-#define smp_mb__after_clear_bit()      barrier()
-
 #ifdef CONFIG_SMP
 /*
  * These functions are the basis of our bit ops.