mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: Andries.Brouwer@cwi.nl
Cc: linux-kernel@vger.kernel.org
Subject: Re: set_rtc_mmss: can't update from 0 to 59
Date: Sun, 17 Dec 2000 19:47:37 -0800	[thread overview]
Message-ID: <20001217194737.C11947@one-eyed-alien.net> (raw)
In-Reply-To: <UTC200012172054.VAA173604.aeb@aak.cwi.nl>
In-Reply-To: <UTC200012172054.VAA173604.aeb@aak.cwi.nl>; from Andries.Brouwer@cwi.nl on Sun, Dec 17, 2000 at 09:54:18PM +0100

[-- Attachment #1: Type: text/plain, Size: 1686 bytes --]

On Sun, Dec 17, 2000 at 09:54:18PM +0100, Andries.Brouwer@cwi.nl wrote:
> What architecture?

i386

> What kernel version?

2.4.0-test13-pre2, but this has been happening for a while.

> Are you in fact running xntpd?

Yes.

> > According to the notes in the code, this should work if my RTC
> > is less than 15 minutes off... which I can guarantee it is.
> 
> Well, since you looked at the source:
> For some randomly chosen kernel version and architecture it does
> 
>         if (abs(real_minutes - cmos_minutes) < 30) {
> 		update_cmos()
> 	} else {
> 		printk("set_rtc_mmss: can't update from %d to %d\n",
> 		       cmos_minutes, real_minutes);
> 	}
> 
> so if your cmos time is 0.001 sec ahead of your system time
> then around the hour you'll see
> 	set_rtc_mmss: can't update from 0 to 59

Ahh... I think I see.  While the math says "if the diference between the
real time and the cmos time is less than 30 min", it doesn't recognize that
the time difference between 2:59 and 3:00 is only 1 min.

Hrm.. the logic to get this right is always the type of thing that gets
me... that's why I usually calculate things the UNIX way -- seconds since
an epoch.

> Of course, messing with the cmos clock at all was a rather bad idea,
> but that is a different discussion.

True enough...  but, the question is, how do we fix this?  Make the logic
more buff?  Or change the algorithm to use something like minutes since the
epoch?

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

We can customize our colonels.
					-- Tux
User Friendly, 12/1/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2000-12-18  4:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-17 20:54 Andries.Brouwer
2000-12-18  3:47 ` Matthew Dharm [this message]
2000-12-18  8:46   ` Russell King
2000-12-19 21:13     ` Oliver Xymoron
2000-12-19 22:25       ` Russell King
2000-12-19 22:53         ` Oliver Xymoron
2000-12-21  9:28   ` Paul Gortmaker
2000-12-21 10:07     ` Russell King
  -- strict thread matches above, loose matches on Subject: below --
2000-12-18 13:10 Andries.Brouwer
2000-12-18 16:48 ` Matthew Dharm
2000-12-17 20:32 Matthew Dharm
2000-12-18 13:11 ` Matthias Andree

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=20001217194737.C11947@one-eyed-alien.net \
    --to=mdharm-kernel@one-eyed-alien.net \
    --cc=Andries.Brouwer@cwi.nl \
    --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

all inboxes | Powered by JetHome®