Re: PROBLEM: Linux updates RTC secretly when clock synchronizes

Kurt Roeckx (Q@ping.be)
Thu, 1 Nov 2001 02:26:08 +0100


On Thu, Nov 01, 2001 at 12:52:19AM +0000, Riley Williams wrote:
>
> > Note that hwclock does not adjust the clock if the error is smaller
> > than 1 second, or it already wrote to the RTC is the past 23 hours.
>
> I knew about the "not less than 1 second" restriction, but not the "only
> once a day" restriction. Can you confirm that the latter restriction is
> indeed the case please?

Oh, I made a little mistake.

It doesn't recalculate the factor if it did in the last 23 hours,
too make it more accurate. The calculation isn't really
accurate, but gets more accurate the longer the period between
them.

In adjust_drift_factor():

} else if ((hclocktime - adjtime_p->last_calib_time) < 23 * 60 * 60) {
if (debug)
printf(_("Not adjusting drift factor because it has been less than a "
"day since the last calibration.\n"));

Kurt

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