[PATCH 5/7] at91 : fix dirty hack for the selfrefresh function

Arnd Bergmann arnd.bergmann at linaro.org
Wed Jan 11 13:27:18 EST 2012


On Wednesday 11 January 2012, Russell King - ARM Linux wrote:
> > @@ -49,9 +49,9 @@ static int at91_enter_idle(struct cpuidle_device *dev,
> >       else if (index == 1) {
> >               asm("b 1f; .align 5; 1:");
> >               asm("mcr p15, 0, r0, c7, c10, 4");      /* drain write buffer */
> > -             saved_lpr = sdram_selfrefresh_enable();
> > +             sdram_selfrefresh_enable(&rs);
> 
> What's the point of draining the write buffer if you then pass a buffer
> to this function to write data to?
> 
> If the requirement is that the write buffer is drained before issue a
> wait-for-interrupt instruction (in cpu_do_idle()) then this code
> violates that.

Does that mean the existing AT91SAM9G45 version of sdram_selfrefresh_enable
is broken already? It writes to the static saved_lpr1 variable after
the write buffers are drained, which is what this patch was trying to
clean up.

	Arnd



More information about the linux-arm-kernel mailing list