Util-Linux package development
 help / color / mirror / Atom feed
From: J William Piggott <elseifthen@gmx.com>
To: Andreas Henriksson <andreas@fatal.se>, util-linux@vger.kernel.org
Cc: Serge Schneider <serge@raspberrypi.org>
Subject: Re: hwclock's synchronize_to_clock_tick_rtc returns inconsistent values
Date: Sun, 19 Apr 2015 20:16:08 -0400	[thread overview]
Message-ID: <55344548.6050102@gmx.com> (raw)
In-Reply-To: <20150416203604.GA6523@fatal.se>


On 04/16/2015 04:36 PM, Andreas Henriksson wrote:
> Hello!
> 
> The below forwarded issue seems to have been introduced in
> commit ab8f402952301106ad0bd5c5a51dc
> "hwclock: don't confuse users with select() timeout warning"
> 
> This issue is also tracked at http://bugs.debian.org/782726
> 
> Regards,
> Andreas Henriksson
> 
> ----- Forwarded message from Serge Schneider <serge@raspberrypi.org> -----
> 
> Date: Thu, 16 Apr 2015 20:24:26 +0100
> From: Serge Schneider <serge@raspberrypi.org>
> To: submit@bugs.debian.org
> Subject: Bug#782726: util-linux: hwclock's synchronize_to_clock_tick_rtc
> 	returns inconsistent values
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101
> 	Thunderbird/31.6.0
> 
> Package: util-linux
> Version: 2.25.2-6
> Severity: normal
> 
> Dear Maintainer,
>                         rc = select(rtc_fd + 1, &rfds, NULL, NULL, &tv);
>                         ret = 1;
>                         if (rc == -1)
>                                 warn(_("select() to %s to wait for clock tick
> failed"),
>                                      rtc_dev_name);
>                         else if (rc == 0 && debug)
>                                 printf(_("select() to %s to wait for clock
> tick timed out"),
>                                      rtc_dev_name);
>                         else
>                                 ret = 0;
>

Karel,

The select time out still needs to return 1, so the debug test should
have been a separate statement.

I don't have time to patch and test this right now, but I can do it
later if you want?


> When 'select' times out and returns 0, synchronize_to_clock_tick_rtc returns
> either 1 or 0, depnding on whether the -D option (debug) was used. This causes
> hwclock -r to succeed and hwclock -r -D to return an error. In one case, it
> just fails, in the other, the values are off by the timeout period (10
> seconds, in this version).
> 
> pi@test-pi ~/dev/util-linux-2.25.2 $ sudo ./hwclock -r
> Thu 16 Apr 2015 19:18:44 UTC  -10.016913 seconds
> pi@test-pi ~/dev/util-linux-2.25.2 $ sudo ./hwclock -r -D
> hwclock from util-linux 2.25.2
> Using the /dev interface to the clock.
> Last drift adjustment done at 1429205484 seconds after 1969
> Last calibration done at 1429205484 seconds after 1969
> Hardware clock is on UTC time
> Assuming hardware clock is kept in UTC time.
> Waiting for clock tick...
> select() to /dev/rtc0 to wait for clock tick timed out...synchronization
> failed
> 
> ----- End forwarded message -----
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2015-04-20  0:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 20:36 hwclock's synchronize_to_clock_tick_rtc returns inconsistent values Andreas Henriksson
2015-04-20  0:16 ` J William Piggott [this message]
2015-04-20 12:21   ` Karel Zak
2015-04-21  2:50     ` J William Piggott
2015-04-22  2:18       ` J William Piggott
2015-04-22  7:46         ` Karel Zak
2015-04-22 16:45           ` J William Piggott
2015-04-22 18:07             ` Andreas Henriksson

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=55344548.6050102@gmx.com \
    --to=elseifthen@gmx.com \
    --cc=andreas@fatal.se \
    --cc=serge@raspberrypi.org \
    --cc=util-linux@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