lkml.org 
[lkml]   [2011]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH V5 1/4] cpuidle: Move dev->last_residency update to driver enter routine, remove dev->last_state
On Mon, Jun 06, 2011 at 07:09:26PM +0530, Trinabh Gupta wrote:
> diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
> index 1cfeac1..4696a0d 100644
> --- a/arch/arm/mach-at91/cpuidle.c
> +++ b/arch/arm/mach-at91/cpuidle.c
> @@ -41,10 +41,10 @@ static int at91_enter_idle(struct cpuidle_device *dev,
>
> local_irq_disable();
> do_gettimeofday(&before);
> - if (state == &dev->states[0])
> + if (index == 0)
> /* Wait for interrupt state */
> cpu_do_idle();
> - else if (state == &dev->states[1]) {
> + else if (index == 1) {
> asm("b 1f; .align 5; 1:");
> asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */

While looking through this patch, it is probably worth pointing out for
the AT91 folk that this is broken. Here's an extract from the GCC manual:

| Similarly, you can't expect a sequence of volatile `asm' instructions
| to remain perfectly consecutive. If you want consecutive output, use a
| single `asm'. Also, GCC will perform some optimizations across a
| volatile `asm' instruction; GCC does not "forget everything" when it
| encounters a volatile `asm' instruction the way some other compilers do.

It might be a good idea to fix those two asm() statements into one.


\
 
 \ /
  Last update: 2011-06-06 15:57    [W:0.077 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site