Skip to contentSkip to conversation

ARM: L2X0: add explicit cpu_relax() for busy wait loop

PATCH New Barry Song 3 participants 3 messages Aug 24, 2011 Arm (32-bit)

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/2 ARM: L2X0: add explicit cpu_relax() for busy wait loop

using cpu_relax in busy loops is a well-known idiom in the kernel. It's more for documentation purposes than technically needed here.

---
 arch/arm/mm/cache-l2x0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/cache-l2x0.c +1 -1
index 2ebbc7c..966b3bd 100644
@@ -37,7 +37,7 @@ static inline void cache_wait_way(void __iomem *reg, unsigned long mask)
 {
 	/* wait for cache operation by line or way to complete */
 	while (readl_relaxed(reg) & mask)
-		;
+		cpu_relax();
 }
 
 #ifdef CONFIG_CACHE_PL310
Signature · 6 lines
1.7.1



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog