Skip to content

Commit 8715466

Browse files
Peter Zijlstraingomolnar
authored andcommitted
arch,arm64: Convert smp_mb__*()
AARGH64 uses ll/sc primitives that do not imply any barriers for the normal atomics, therefore smp_mb__{before,after} should be a full barrier. Since AARGH64 doesn't use asm-generic/barrier.h, add the required definitions to its asm/barrier.h. 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-8p5iclqgy78al33kck3ht7nr@git.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chen Gang <gang.chen@asianux.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Will Deacon <will.deacon@arm.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 030d017 commit 8715466

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

‎arch/arm64/include/asm/atomic.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
152152

153153
#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
154154

155-
#define smp_mb__before_atomic_dec() smp_mb()
156-
#define smp_mb__after_atomic_dec() smp_mb()
157-
#define smp_mb__before_atomic_inc() smp_mb()
158-
#define smp_mb__after_atomic_inc() smp_mb()
159-
160155
/*
161156
* 64-bit atomic operations.
162157
*/

‎arch/arm64/include/asm/barrier.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ do { \
9898
#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
9999
#define nop() asm volatile("nop");
100100

101+
#define smp_mb__before_atomic() smp_mb()
102+
#define smp_mb__after_atomic() smp_mb()
103+
101104
#endif /* __ASSEMBLY__ */
102105

103106
#endif /* __ASM_BARRIER_H */

‎arch/arm64/include/asm/bitops.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,8 @@
1717
#define __ASM_BITOPS_H
1818

1919
#include <linux/compiler.h>
20-
2120
#include <asm/barrier.h>
2221

23-
/*
24-
* clear_bit may not imply a memory barrier
25-
*/
26-
#ifndef smp_mb__before_clear_bit
27-
#define smp_mb__before_clear_bit() smp_mb()
28-
#define smp_mb__after_clear_bit() smp_mb()
29-
#endif
30-
3122
#ifndef _LINUX_BITOPS_H
3223
#error only <linux/bitops.h> can be included directly
3324
#endif

0 commit comments

Comments
 (0)