Subject: Re: [patch 27/35] Work around errata 4290

From: [email-masked] (Olof Johansson)
Date: Thu, 5 Jul 2007 14:26:44 -0500

On Thu, Jul 05, 2007 at 08:50:21PM +0200, Gabriel Paubert wrote:
> On Thu, Jul 05, 2007 at 12:03:00PM -0500, Olof Johansson wrote:
> > Workaround for errata 4290: The decrementer ticks at half the expected rate
> > so load it with half the value it would otherwise be loaded with.
> > 
> > 
> > Index: 2.6.21/include/asm-powerpc/time.h
> > ===================================================================
> > --- 2.6.21.orig/include/asm-powerpc/time.h
> > +++ 2.6.21/include/asm-powerpc/time.h
> > @@ -173,6 +173,13 @@ static inline unsigned int get_dec(void)
> >  
> >  static inline void set_dec(int val)
> >  {
> > +#ifdef CONFIG_PPC_PASEMI
> > +	/* PA6T rev Ax have decrementer ticking at 1/2 tb rate */
> > +	val >>= 2;
> 
> Comment does not match code: looks like a divide by 4 to me!

You're right. Thanks for catching it.

Never caught it because the timer code behaves just fine anyway, but
it'll waste power by waking up twice as often when idle.

-Olof