diff options
author | Will Deacon <will.deacon@arm.com> | 2010-06-21 10:29:03 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-01 05:13:52 -0400 |
commit | 534be1d5a2da940ecc5e528992ea4ace8658157a (patch) | |
tree | 8b6f7a75efd167ec05ee70ee3e0e900ce4e3ea4d | |
parent | cc9897df72ddea33762f9d24ecaa2b23ef0ad1b4 (diff) |
ARM: 6194/1: change definition of cpu_relax() for ARM11MPCore
Linux expects that if a CPU modifies a memory location, then that
modification will eventually become visible to other CPUs in the system.
On an ARM11MPCore processor, loads are prioritised over stores so it is
possible for a store operation to be postponed if a polling loop immediately
follows it. If the variable being polled indirectly depends on the outstanding
store [for example, another CPU may be polling the variable that is pending
modification] then there is the potential for deadlock if interrupts are
disabled. This deadlock occurs in the KGDB testsuire when executing on an
SMP ARM11MPCore configuration.
This patch changes the definition of cpu_relax() to smp_mb() for ARMv6 cores,
forcing a flushing of the write buffer on SMP systems before the next load
takes place. If the Kernel is not compiled for SMP support, this will expand
to a barrier() as before.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/include/asm/processor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 6a89567ffc5b..7bed3daf83b8 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h | |||
@@ -91,7 +91,11 @@ extern void release_thread(struct task_struct *); | |||
91 | 91 | ||
92 | unsigned long get_wchan(struct task_struct *p); | 92 | unsigned long get_wchan(struct task_struct *p); |
93 | 93 | ||
94 | #if __LINUX_ARM_ARCH__ == 6 | ||
95 | #define cpu_relax() smp_mb() | ||
96 | #else | ||
94 | #define cpu_relax() barrier() | 97 | #define cpu_relax() barrier() |
98 | #endif | ||
95 | 99 | ||
96 | /* | 100 | /* |
97 | * Create a new kernel thread | 101 | * Create a new kernel thread |