Hi, Last year I upstreamed some patches to allow use of Linux /dev/rtc as reference clock. This helped us on an embedded system that can be offline for multiple days at a time and the clock drift of the SoC's internal timer was higher than tolerable, compared to that of the external RTC.
With the support now in master, it's possible to keep two configs, one for each of NTP and RTC as reference clock and switching between them as needed. The logical next step would be to allow having a single config that addresses our use case, which I believe would be a generally useful default for many embedded system: - The kernel allows only one process to open /dev/rtc at a time. Chrony should gain an IPC command by which chronyc can set the time on the RTC, when used as reference clock. - Setting the time this way, discards all samples and then sampling starts fresh with a clean slate - The RTC reference clock should only be selected, when there are no other usable non-RTC reference clocks - The 11-minute kernel programming of the RTC must always be disabled, once a RTC reference clock has been initialized - rtcsync when the RTC is a selected reference clock should be a no-op - rtcsync when the RTC is _not_ the selected reference clock should periodically program the time into the RTC like the kernel usually does, once the drift exceeds a threshold A future follow-up to that could be using RTC_PARAM_CORRECTION to compensate RTC oscillator imprecision. Does this make sense? Any comments before I try implementing it? Thanks! Ahmad -- To unsubscribe email chrony-dev-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-dev-requ...@chrony.tuxfamily.org with "help" in the subject. Trouble? Email listmas...@chrony.tuxfamily.org.