Skip to content

Commit

Permalink
[ARM SMP] Fix another ARMv6 bitop problem
Browse files Browse the repository at this point in the history
We sometimes forgot to check whether the exclusive store succeeded.
Ensure that we always check.  Also ensure that we always use the
out of line versions, since the inline versions are not SMP safe.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jul 28, 2005
1 parent 505d7b1 commit e7ec029
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/lib/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
1: ldrexb r2, [r1]
\instr r2, r2, r3
strexb r0, r2, [r1]
cmpne r0, #0
cmp r0, #0
bne 1b
mov pc, lr
.endm
Expand Down
5 changes: 5 additions & 0 deletions include/asm-arm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ extern int _find_next_zero_bit_be(const void * p, int size, int offset);
extern int _find_first_bit_be(const unsigned long *p, unsigned size);
extern int _find_next_bit_be(const unsigned long *p, int size, int offset);

#ifndef CONFIG_SMP
/*
* The __* form of bitops are non-atomic and may be reordered.
*/
Expand All @@ -241,6 +242,10 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
(__builtin_constant_p(nr) ? \
____atomic_##name(nr, p) : \
_##name##_be(nr,p))
#else
#define ATOMIC_BITOP_LE(name,nr,p) _##name##_le(nr,p)
#define ATOMIC_BITOP_BE(name,nr,p) _##name##_be(nr,p)
#endif

#define NONATOMIC_BITOP(name,nr,p) \
(____nonatomic_##name(nr, p))
Expand Down

0 comments on commit e7ec029

Please sign in to comment.