aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2017-10-03 22:46:14 -0400
committerJames Hogan <jhogan@kernel.org>2017-11-13 11:49:01 -0500
commita3f143106596d739e7fbc4b84c96b1475247d876 (patch)
tree54b5775c98fe42831ad7f50f99d1ac22da5df65c
parent4dc4704c0024751fe2b4532cf33c80376f1add70 (diff)
MIPS: cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN don't work for 32-bit SMP
__cmpxchg64_local_generic() is atomic only w.r.t tasks and interrupts on the same CPU (that's what the 'local' means). We can't use it to implement cmpxchg64() in SMP configurations. So, for 32-bit SMP configurations: - Don't define cmpxchg64() - Don't enable HAVE_VIRT_CPU_ACCOUNTING_GEN, which requires it Fixes: e2093c7b03c1 ("MIPS: Fall back to generic implementation of ...") Fixes: bb877e96bea1 ("MIPS: Add support for full dynticks CPU time accounting") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Deng-Cheng Zhu <dengcheng.zhu@mips.com> Cc: linux-mips@linux-mips.org Cc: <stable@vger.kernel.org> # 4.1+ Patchwork: https://patchwork.linux-mips.org/patch/17413/ Signed-off-by: James Hogan <jhogan@kernel.org>
-rw-r--r--arch/mips/Kconfig2
-rw-r--r--arch/mips/include/asm/cmpxchg.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 43411118dd4f..b09b644cd57c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -64,7 +64,7 @@ config MIPS
64 select HAVE_PERF_EVENTS 64 select HAVE_PERF_EVENTS
65 select HAVE_REGS_AND_STACK_ACCESS_API 65 select HAVE_REGS_AND_STACK_ACCESS_API
66 select HAVE_SYSCALL_TRACEPOINTS 66 select HAVE_SYSCALL_TRACEPOINTS
67 select HAVE_VIRT_CPU_ACCOUNTING_GEN 67 select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP
68 select IRQ_FORCED_THREADING 68 select IRQ_FORCED_THREADING
69 select MODULES_USE_ELF_RELA if MODULES && 64BIT 69 select MODULES_USE_ELF_RELA if MODULES && 64BIT
70 select MODULES_USE_ELF_REL if MODULES 70 select MODULES_USE_ELF_REL if MODULES
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 903f3bf48419..ae2b4583b486 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -202,8 +202,10 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
202#else 202#else
203#include <asm-generic/cmpxchg-local.h> 203#include <asm-generic/cmpxchg-local.h>
204#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 204#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
205#ifndef CONFIG_SMP
205#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) 206#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
206#endif 207#endif
208#endif
207 209
208#undef __scbeqz 210#undef __scbeqz
209 211