Re: 40ms/10ms error in do_gettimeofday()

From: Boris Okun (bokun@home.com)
Date: Thu Apr 06 2000 - 12:50:59 EST


Hi Bernard,

Bernard Imbert wrote:
>
> Hi Boris,
> Thanks for this answer. The do_poor_nanotime() function is introduced
> as a replacement of do_slow_gettimeoffset() by the patches to apply
> for the PPSKit0.9.1 (which drives the GPS receiver).
Ok, thanks.

> The corrections made by Jason look similar to what I have done in my
> application, but as I said I've never experienced any lost IRQ detection
> (so I would never enter the "if (irqpend & 0x01)" from Jason's code....
> This is really the point I wander about : why, just after the 8254 interval
> timer has count down to 1 (so there should be a pulse on the OUT pin)
> don't we have the IRQ made pending in the IRR register of the 8259?
> Is there some part of the code which masks this IRQ in the IMR reg?

Perhaps, I misundrestand what you wrote originally. It seems to me that
you don't see
lost IRQ if (jiffies_t == jiffies_p), so it is not during the first
call of do_poor_nanotime() after IRQ0 have happened. So possibly
inbetween calls you had interrupts enabled.

Now, during the first call of do_poor_nanotime() the condition
if ( count >= 11920 )
can be false if the IRQ0 happened long ago ( more then 12 ticks?)

The fact that it works for you, I think, just means that you don't run
with disabled interrupts for such a long time.

> Anyway, the following seems to correct my problems (even though I
> should run my application for years to be sure there is not any other
> situations where the time is wrong!)

Could you try Jason's code and see if it works?

> Bernard

Boris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:17 EST