Skip to content

Commit 339b07f

Browse files
committed
ARC: add smp_mb around atomic_add_unless
Per Documentation/atomic_ops.txt this is needed ! Signed-off-by: Vineet Gupta <[email protected]>
1 parent 465e7b9 commit 339b07f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arc/include/asm/atomic.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,15 @@ ATOMIC_OP(and, &=, and)
157157
#define __atomic_add_unless(v, a, u) \
158158
({ \
159159
int c, old; \
160+
\
161+
smp_mb(); \
162+
\
160163
c = atomic_read(v); \
161164
while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c)\
162165
c = old; \
166+
\
167+
smp_mb(); \
168+
\
163169
c; \
164170
})
165171

0 commit comments

Comments
 (0)