public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 500 ms offset in i386 Real Time Clock setting
@ 2001-01-06 19:35 BJerrick
  2001-01-06 20:19 ` Kurt Roeckx
  2001-01-07 12:38 ` Paul Gortmaker
  0 siblings, 2 replies; 6+ messages in thread
From: BJerrick @ 2001-01-06 19:35 UTC (permalink / raw)
  To: aeb, linux-kernel, p_gortmaker

    Neither hwclock nor the /dev/rtc driver takes the following comment from
set_rtc_mmss() in arch/i386/kernel/time.c into account.  As a result, using
hwclock --systohc or --adjust always leaves the Hardware Clock 500 ms ahead of
the System Clock:

     * In order to set the CMOS clock precisely, set_rtc_mmss has to be
     * called 500 ms after the second nowtime has started, because when
     * nowtime is written into the registers of the CMOS clock, it will
     * jump to the next second precisely 500 ms later. Check the Motorola
     * MC146818A or Dallas DS12887 data sheet for details.

(It looks like the only thing that does account for it is the 11-minute
STA_UNSYNC updater in do_timer_interrupt(), in arch/i386/kernel/time.c .)

Shouldn't there be some kernel interface that hides this machine-dependency
from user-level code; i.e., that sets time more precisely?

Bruce Jerrick
Portland, Oregon, USA
email:   bjerrick@easystreet.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: 500 ms offset in i386 Real Time Clock setting
@ 2001-01-06 21:56 Andries.Brouwer
  0 siblings, 0 replies; 6+ messages in thread
From: Andries.Brouwer @ 2001-01-06 21:56 UTC (permalink / raw)
  To: Andries.Brouwer, BJerrick, linux-kernel, p_gortmaker

> Neither hwclock nor the /dev/rtc driver takes the following comment from
> set_rtc_mmss() in arch/i386/kernel/time.c into account.
> As a result, using hwclock --systohc or --adjust always leaves the
> Hardware Clock 500 ms ahead of the System Clock

By pure coincidence Q@ping.be sent me patches just one day ago.
I still have to look at the details, but it seems very likely
that this will be corrected in the next util-linux release.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: 500 ms offset in i386 Real Time Clock setting
@ 2001-01-07 17:59 Andries.Brouwer
  2001-01-08  9:59 ` Paul Gortmaker
  0 siblings, 1 reply; 6+ messages in thread
From: Andries.Brouwer @ 2001-01-07 17:59 UTC (permalink / raw)
  To: BJerrick, p_gortmaker; +Cc: Andries.Brouwer, linux-kernel

> I don't have a problem with the rtc driver delaying 500ms

I still haven't looked at things, but two points:
(i) is the behaviour constant on all architectures?
(ii) instead of waiting, isn't it much easier to redefine
what it means to access rtc?
(If you read a certain value then on average you are halfway
that second; if you write a certain value you are precisely
halfway that second. Maybe no delays are needed or desired.)

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-01-08 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-06 19:35 500 ms offset in i386 Real Time Clock setting BJerrick
2001-01-06 20:19 ` Kurt Roeckx
2001-01-07 12:38 ` Paul Gortmaker
  -- strict thread matches above, loose matches on Subject: below --
2001-01-06 21:56 Andries.Brouwer
2001-01-07 17:59 Andries.Brouwer
2001-01-08  9:59 ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox