Bug 150493 - hwclock --systohc sets clock 0.5 seconds slow
hwclock --systohc sets clock 0.5 seconds slow
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-07 13:32 EST by David Gardner
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-06 07:18:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Change timing delay to wait for half-second rather than full second before writing to CMOS (979 bytes, patch)
2005-03-07 13:38 EST, David Gardner
no flags Details | Diff

  None (edit)
Description David Gardner 2005-03-07 13:32:07 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
The kernel code, when setting the BIOS clock notes that the clock time
ticks to the next second 0.5 seconds after adjusting it  (see
linux/arch/i386/kernel/time.c) It looks like this was a bug fixed in
1995, but I've not checked. This is probably only actually used for
when the system time is externally synced, but I havn't checked.

hwclock --systohc sets the CMOS clock at the 1 second boundry and thus
causes the clock to be wrong by 500ms each time it is reset.
If (as is normal on FC3 at least) the clock is set every shutdown then
the clock will have a reboot-count related drift as well as the
natural drift problems of the clock. Note that this also mucks up the
drift calculations, of course.



Version-Release number of selected component (if applicable):
util-linux-2.12a-16 and earlier

How reproducible:
Always

Steps to Reproduce:
1.sync system clock to external timeserver
2.hwclock --systohc ; hwclock --hctosys
3.Repeat (2) another 9 times for greater visibility.
4.set system clock to external timeserver. 
5.hwclock ; time +%c%N
Note the 0.5 second offset for each time (2) was done - total of about
 5 seconds.

Additional info:
Comment 1 David Gardner 2005-03-07 13:38:39 EST
Created attachment 111752 [details]
Change timing delay to wait for half-second rather than full second before writing to CMOS

I've hacked together this patch and it seems to work - hwclock --systohc now
sets the cmos clock to the same value the kernel does when in "11 minute mode",
as opposed to 0.5 seconds out.	Obviously another set of eyes should check it!
Comment 2 Matthew Miller 2006-07-10 18:32:06 EDT
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!
Comment 3 Tomas Mraz 2007-01-25 04:59:58 EST
Still happens.
Comment 4 Karel Zak 2007-03-19 19:35:30 EDT
The bug has been fixed in the util-linux-ng upstream code and will be also fixed
in FC ASAP.

Note You need to log in before you can comment on or make changes to this bug.