Trouble with do_gettimeofday()

David A. Schleef (dschleef@intelspm.physics.purdue.edu)
Wed, 15 May 1996 15:06:25 -0500 (EST)


I am using 1.3.100 as a base for writing a driver for several
data acquisition boards. While testing, I noticed that
do_gettimeofday() in arch/i381/kernel/time.c is not monotonic
when called from an interrupt.

Specifically, it seems as though do_slow_gettimeoffset() returns
the wrong value during the period between the timer interrupt
and when update_wall_timer_one_tick() updates xtime.tv_usec
in kernel/sched.c. Obviously, since sys_gettimeofday() does not
call do_gettimeofday() during this period, the system call is
not affected. However, several drivers call do_gettimeofday(),
possibly some in interrupts (as mine does).

Is it better to simply say "don't call do_gettimeofday() from
interrupts?"

dave...