It can happen two ways (and I am not saying it returns -1,
but some large number ~ 1hr worth of usecs). The first
possibility is an overflow in the conversion of tsc ticks to
usec. This is more likely a problem if the processor is
running at high speeds, AND interrupts have been held off
for a while. The second possibility is that either the
latch read failed to latch or the PIT is actually not
resetting at count = 0. This is, I think, the VIA chip
bug. If there is no "correction" code for this bug, the net
result will be a slow and erratic clock. If there is
correction software in place, it could result in the
observed time jump by providing an invalid count which is
then used by do_gettimeoffset(). The reason the fault
clears is a.) on the next tick a valid count will be
obtained, and b) the value from do_gettimeoffset() is never
rolled into the wall clock.
> I note that this error is fixed in the
> next time() call, so I would instead expect the error to be one involving the
> conversion of tv_secs/tv_usecs into the seconds return from time().
>
> One possible way to check this out would be to change the test program from
> using the time() call to using gettimeofday(), and to ignore tv_usecs.
And just where does time() get the time of day if not from
gettimeofday()?
>
> Hope this helps,
>
> Ruth
>
> --
> Ruth Ivimey-Cook
> Software engineer and technical writer.
-- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Real time sched: http://sourceforge.net/projects/rtsched/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/