linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Correct WFE() in asm/spinlock.h for Thumb-2
@ 2011-02-08 15:20 Dave Martin
  2011-02-08 16:40 ` Russell King - ARM Linux
  2011-02-09 16:38 ` Nicolas Pitre
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Martin @ 2011-02-08 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

The content for ALT_SMP() in the definition of WFE() expands to 6
bytes (IT cc ; WFEcc.W), which breaks the assumptions of the fixup
code, leading to lockups when the affected code gets run.

This patch works around the problem by explicitly using an
IT + WFEcc.N pair.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
 arch/arm/include/asm/spinlock.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index da1af52..7cba79c 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -18,7 +18,12 @@
 
 #ifdef CONFIG_THUMB2_KERNEL
 #define SEV		ALT_SMP("sev.w", "nop.w")
-#define WFE(cond)	ALT_SMP("wfe" cond ".w", "nop.w")
+#define WFE(cond)	ALT_SMP(		\
+	"it " cond "\n\t"			\
+	"wfe" cond ".n",			\
+						\
+	"nop.w"					\
+)
 #else
 #define SEV		ALT_SMP("sev", "nop")
 #define WFE(cond)	ALT_SMP("wfe" cond, "nop")
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-09 17:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 15:20 [PATCH] ARM: Correct WFE() in asm/spinlock.h for Thumb-2 Dave Martin
2011-02-08 16:40 ` Russell King - ARM Linux
2011-02-08 16:56   ` Dave Martin
2011-02-09 10:20     ` Will Deacon
2011-02-09 13:04       ` Russell King - ARM Linux
2011-02-09 16:38 ` Nicolas Pitre
2011-02-09 17:00   ` Dave Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).