[patch 06/10] 40x decrementer fixes

Sergei Shtylyov sshtylyov at ru.mvista.com
Mon Aug 6 00:19:40 EST 2007


Benjamin Herrenschmidt wrote:

>>>Allow generic_calibrate_decr to work for 40x platforms.  Given that the hardware
>>>behavior is identical, this also changes the set_dec function to reload the PIT
>>>on 40x to match the behavior 44x currently has.

>>    Why bother doing this?! This will only warrant you imprecise decrementer 
>>interrupts while it should be interrupting at the precise period currently (if 
>>you load PIT once)...

> Because that's what the kernel timekeeping code expects ? The reference
> time is the timebase and it doesn't drift.

> The DEC/PIT is commonly used to trigger any timing, such as what is done
> for lost interrupts on some platforms. Also, with dynticks, we'll most
> certainly want variable reload values as well.

    That's another matter. :-)
    BTW, because of that mere return in set_dec() for the 40x case I had to 
write to the PIT myself in the decrementer clockevent's set_next_event() 
method -- while for classic PPC I was just calling set_dec(n-1)...

> So I'm very happy to have Josh change the code that way. It makes things
> more consistent accross the board and removes confusion.

    Yeah, it's OK now that's my temporary confusion has passed.
    Well, it wasn't only not only mine -- the set_dec() code was suggesting 
auto-reload mode, and has been obviosuly copied from <asm-ppc/time.h>, so 
arch/ppc/ was using the auto-reload mode indeed.

> Ben.

WBR, Sergei



More information about the Linuxppc-dev mailing list