[PATCH 08/10] ARM: clps711x: Add CLPS711X cpuidle driver

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Jul 22 07:40:10 EDT 2013


On Sun, Jul 21, 2013 at 08:11:38AM +0400, Alexander Shiyan wrote:
> > > +static int clps711x_cpuidle_halt(struct cpuidle_device *dev,
> > > +				 struct cpuidle_driver *drv, int index)
> > > +{
> > > +	writel(1, clps711x_halt);
> > 
> > In what the 'clps711x_halt' differs from the usual WFI (cpu_do_idle) ?
> 
> AFAIK, ARM720T does not implement the WFI instruction.
> "HALT" register in CLPS711X do the same:
> "A write to this location will put the system into the Idle State by
> halting the clock to the processor until an interrupt is generated."
> 
> > > +	asm volatile ("mov r0, r0");
> > > +	asm volatile ("mov r0, r0");
> > 
> > Why are needed these two volatile ?
> 
> Two NOP instructions necessary following the enable or disable of the MMU.
> Documentation not say anything about using this for "HALT", maybe it's the
> remnants of the old code. I will remove it.

However, bear in mind that this is not how you insert two nops after
something; the compiler is free to add anything it likes before,
between separate asm() statements, or after them, even if they're
marked volatile.



More information about the linux-arm-kernel mailing list