lkml.org 
[lkml]   [2001]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: gettimeofday question
Russell King wrote:
> > I've noticed that one of my machines here suffers from the "time going
> > backwards problem" and so started thinking about the x86 solution.
> >
> > I've come to the conclusion that it has a hole which could cause it
> > to return the wrong time in one specific case:
> >
> > - in do_gettimeofday(), we disable irqs (read_lock_irqsave)
> > - the ISA timer wraps, but we've got interrupts disabled, so no update
> > of xtime or jiffies occurs
> > - in do_slow_gettimeoffset(), we read the timer, which has wrapped
> > - since jiffies_p != jiffies, we do not apply any correction
> > - our idea of time is now one jiffy slow.
>
> I never heard any response to this. Could some knowledgeable person please
> take a look at it?

do_slow_gettimeoffset() is supposed to correct for wrapping.
But where it says:

#define BUGGY_NEPTUN_TIMER

if( jiffies_t == jiffies_p ) {
if( count > count_p ) {
/* the nutcase */

Shouldn't that say "count < count_p"?

-- Jamie
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.071 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site