public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* "hwclock --systohc" and tick synchronization
@ 2013-03-20 20:53 Daniel Drake
  2013-03-21  8:02 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2013-03-20 20:53 UTC (permalink / raw)
  To: util-linux

Hi,

We are looking at situations with OLPC XO laptops where all RTC power
has been lost and hence the system has lost its time/date and RTC
contents are invalid.

The usual thing to do in this case is to reset the system time to the
current moment and then use hwclock to save it to the RTC.

However, this is proving quite confusing.

# hwclock --systohc
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: No
such file or directory

Firstly, the corresponding warn() in hwclock-rtc.c should be warnx()
so that it does not print the errno message. When select returns 0
(timeout), interpreting errno does not make sense.

Secondly, did that hwclock command fail or succeed? Our users and a
developer saw that output and concluded "hwclock is broken" and filed
a bug. Having seen the bug report, I drew the same conclusion. Only
upon testing further I realised that this is only a warning and
hwclock did go on and set the RTC time appropriately.

So, can this message be silenced completely, or can we add a "RTC
successfully set from system clock"  success message that appears
afterwards?

Let me know if there is a preference, then I'll go and send a patch.

Thanks
Daniel

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

* Re: "hwclock --systohc" and tick synchronization
  2013-03-20 20:53 "hwclock --systohc" and tick synchronization Daniel Drake
@ 2013-03-21  8:02 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2013-03-21  8:02 UTC (permalink / raw)
  To: Daniel Drake; +Cc: util-linux

On Wed, Mar 20, 2013 at 02:53:55PM -0600, Daniel Drake wrote:
> However, this is proving quite confusing.
> 
> # hwclock --systohc
> hwclock: select() to /dev/rtc0 to wait for clock tick timed out: No
> such file or directory

 BTW, in util-linux 2.22.1 the timeout has been changed from 5 to 10
 seconds, I guess you have older version.

> So, can this message be silenced completely, or can we add a "RTC
> successfully set from system clock"  success message that appears
> afterwards?

 Fixed, now the message is printed only in --debug output.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2013-03-21  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 20:53 "hwclock --systohc" and tick synchronization Daniel Drake
2013-03-21  8:02 ` Karel Zak

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