diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-06-13 09:43:18 -0400 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-08-31 06:03:46 -0400 |
commit | dfc8d8de855d566eb83a27e58a69741de42a90da (patch) | |
tree | 20083e6d912de45bded2b55c2d4452bfefcfb2fd /arch/mips/include | |
parent | 00f3e689518b8f8d36e333d3b447db18ef22abb3 (diff) |
mips/atomic: Fix cmpxchg64 barriers
There were no memory barriers on the 32bit implementation of
cmpxchg64(). Fix this.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/cmpxchg.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h index f345a873742d..59cf5cbb3883 100644 --- a/arch/mips/include/asm/cmpxchg.h +++ b/arch/mips/include/asm/cmpxchg.h | |||
@@ -290,10 +290,13 @@ static inline unsigned long __cmpxchg64(volatile void *ptr, | |||
290 | * will cause a build error unless cpu_has_64bits is a \ | 290 | * will cause a build error unless cpu_has_64bits is a \ |
291 | * compile-time constant 1. \ | 291 | * compile-time constant 1. \ |
292 | */ \ | 292 | */ \ |
293 | if (cpu_has_64bits && kernel_uses_llsc) \ | 293 | if (cpu_has_64bits && kernel_uses_llsc) { \ |
294 | smp_mb__before_llsc(); \ | ||
294 | __res = __cmpxchg64((ptr), __old, __new); \ | 295 | __res = __cmpxchg64((ptr), __old, __new); \ |
295 | else \ | 296 | smp_llsc_mb(); \ |
297 | } else { \ | ||
296 | __res = __cmpxchg64_unsupported(); \ | 298 | __res = __cmpxchg64_unsupported(); \ |
299 | } \ | ||
297 | \ | 300 | \ |
298 | __res; \ | 301 | __res; \ |
299 | }) | 302 | }) |