Re: 500 ms delay in time saved into RTC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 19, 2018 at 02:31:23PM +0300, Igor Plyatov wrote:
> Dear Karel,
> 
> 
> > Would be possible to somehow detect what is the right default setting for
> > --delay? I mean for example detect architecture / clock HW, etc.
> > 
> > I have no problem with --delay, but it's tuning for advanced users and
> > HW specific stuff. It would be nice to have something more portable.
> > 
> >      Karel
> > 
> 
> As I understood, issue exists only at x86 platform, where
> MC146818-compatible RTC used.
> 
> But even if you will correctly detect platform, there is no guaranty to get
> exactly MC146818 RTC. RTC can be other type. It even can be not single in
> the system.
> 
> What is more or less usable is "/sys/class/rtc/rtcX/name" file, which
> contains driver name.
> For x86 and MC146818-compatible RTC its name is "rtc_cmos". And it can be
> used to distinguish RTC type by hwclock utility.

Implemented. From commit message:

    * add command line option --delay <seconds>
    
    * read RTC type from /sys/class/rtc/rtc<N>/name
    
    * default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible
      determine; otherwise default is 0.


The change should be backwardly compatible in case hwclock is executed
in time /sys is not mounted. The option --delay overwrites everything.

The RTC type and the delay are visible by --verbose.

Maybe you can try it with your HW to test the patch :-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux