linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Riley Williams <rhw@MemAlpha.cx>
To: Alex Bligh <linux-kernel@alex.org.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: PROBLEM: Linux updates RTC secretly when clock synchronizes
Date: Fri, 2 Nov 2001 09:50:23 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0111020026300.22697-100000@Consulate.UFP.CX> (raw)
In-Reply-To: <1301130987.1004623024@[10.132.113.67]>

Hi Alex.

>> The offset needs to be sufficient to handle the case of the RTC
>> being set to local time and the boot and first ntp sync occurring on
>> opposite sides of a Daylight Savings Time change. A couple of
>> timezones use a DST offset of 90 minutes, so if it's less than that,
>> there will be problems.

> There is a related problem, where if you are running something which
> can suspend, like a laptop, but not using integrated apm to do it
> (for instance a laptop which has a broken BIOS), then suspending
> 'freezes' the system time, which is wrong on resume (as the power
> management event appears to be invisible to Linux). Then this goes
> and blats over the (correct) RTC time. If you then get a network
> connection up, ntp won't adjust the time as it's too far out.

That sounds like a configuration error to me, and here's why.

 1. One of the available reference clocks for xntpd is the local
    RTC, type 1 in the list of reference clock types, and that
    should ALWAYS be listed as one of the reference clocks to use,
    but with a higher stratum than any other reference clock used.

 2. My experience with the xntpd driver suggests that if no better
    reference is available and the RTC is one of the listed clocks,
    then it ALWAYS adjusts the time to match the RTC, irrespective
    of the time difference between them.

 3. AFAICT, if xntpd writes to the RTC, then it has achieved true
    synchronisation to a reference clock other than the RTC.

It's for these reasons that I'm rather puzzled by the comments in this
thread so far.

> What I wanted was an option which did the copy the other way on a
> large offset - i.e. keep the RTC in sync for smallish offsets, but
> if the offset is wrong by more than 5 minutes (and RTC is in
> advance), copy RTC to system time as the laptop probably suspended.

If you have the RTC as one of your reference clocks, then this heuristic
is not required as xntpd (at least) does the right thing for you.

> There might of course be a better heuristic to detect this (perhaps
> every time it does the check see if it got out of sync by > the
> interval between checks).

Probably the 'heuristic' of ensuring that the RTC is one of the
reference clocks is sufficient.

> Short of this, it would be useful to be able to turn /off/ futzing
> with the RTC.

True.

Best wishes from Riley.


  reply	other threads:[~2001-11-02 18:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-31  0:33 PROBLEM: Linux updates RTC secretly when clock synchronizes Ian Maclaine-cross
2001-10-31  1:05 ` Kurt Roeckx
2001-10-31  2:55   ` Ian Maclaine-cross
2001-10-31 11:52     ` Kurt Roeckx
2001-11-01  0:52       ` Riley Williams
2001-11-01  1:26         ` Kurt Roeckx
2001-11-01 13:57         ` Alex Bligh - linux-kernel
2001-11-02  9:50           ` Riley Williams [this message]
2001-11-03 11:41             ` Alex Bligh - linux-kernel
2001-11-03 18:35               ` Riley Williams
2001-11-03 19:19                 ` Alex Bligh - linux-kernel
2001-11-03 21:04                 ` Kurt Roeckx
2001-11-06 10:01                 ` Pavel Machek
2001-11-06  9:57             ` Pavel Machek
2001-11-02 12:16 ` Pavel Machek
2001-11-05 23:08   ` Riley Williams
2001-11-06 10:17     ` Pavel Machek
2001-11-07  0:00       ` Riley Williams
2001-11-07  0:44         ` Alex Bligh - linux-kernel
2001-11-07  1:01           ` Kurt Roeckx
2001-11-07  1:15             ` Alex Bligh - linux-kernel
2001-11-07  9:24             ` Russell King
2001-11-08 12:26         ` Pavel Machek
2001-11-08 23:00           ` Riley Williams
2001-11-09  9:32             ` Pavel Machek
2001-11-09 21:11               ` Riley Williams
2001-11-09 21:30                 ` Pavel Machek
2001-11-09 22:54                   ` Riley Williams
2001-11-09 23:10                     ` Mark Zealey
2001-11-10 20:04                     ` Pavel Machek
2001-11-10 20:35                       ` Riley Williams
2001-11-10 20:43                         ` Pavel Machek
2001-11-10 20:49                         ` Doug McNaught
2001-11-06  0:20   ` Ian Maclaine-cross
2001-11-06 10:18     ` Pavel Machek
2001-11-08  5:09       ` Ian Maclaine-cross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0111020026300.22697-100000@Consulate.UFP.CX \
    --to=rhw@memalpha.cx \
    --cc=linux-kernel@alex.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).