Skip to contentSkip to conversation

ARM: mach-ux500: add explicit cpu_relax() for busy wait loop

PATCH New Barry Song 3 participants 4 messages Aug 24, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 2/2 ARM: mach-ux500: 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/mach-ux500/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/cpu.c +1 -1
index 1da23bb..76ee355 100644
@@ -62,7 +62,7 @@ static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask)
 {
 	/* wait for the operation to complete */
 	while (readl_relaxed(reg) & mask)
-		;
+		cpu_relax();
 }
 
 static inline void ux500_cache_sync(void)
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

A message that is not in the archive (sent off-list or not yet received): CACRpkdY_JerDkSRPTLt8KJj1TmZHHAc4RhEOR3X-mjB-VVSjtw@mail.gmail.com

author
#2 lore raw

PATCH 2/2 ARM: mach-ux500: add explicit cpu_relax() for busy wait loop

Quoted 10 lines
Quoted 5 lines

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

Do you want me to push this to the ux500 tree or will you feed it in some other way?

Linus, better push it to ux500 and Arnd pull your ux500.

Quoted 3 lines

Thanks!
Linus Walleij

-barry

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

#3 lore raw

PATCH 2/2 ARM: mach-ux500: add explicit cpu_relax() for busy wait loop

Quoted 1 line · Barry Song

Linus, better push it to ux500 and Arnd pull your ux500.

OK I have it in ux500-core, i'll take care of it.

Linus Walleij