[PATCH] ARM: Correct WFE() in asm/spinlock.h for Thumb-2

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Feb 9 08:04:59 EST 2011


On Wed, Feb 09, 2011 at 10:20:29AM -0000, Will Deacon wrote:
> > the WFE into the 4 bytes expected by ALT_SMP().  For safety, I write
> > it out explicitly: ALT_SMP("wfene", ...) would work sometimes but
> > might not work as expected if the previous instruction has an EQ or NE
> > condition, because then the assembler wouldn't need to insert an extra
> > IT when it generates its output...
> 
> That's really horrible! It might be worth commenting the explicit
> IT in your WFE macro to explain why we can't rely on the assembler
> to generate it for us.

Yes, it's really really horrible.  As I say, I think in future I'm just
going to stick to writing good ARM code and let others worry about how
to make it work properly on T2.



More information about the linux-arm-kernel mailing list