]> git.ipfire.org Git - thirdparty/chrony.git/commit
rtc: extend check for RTCs that don't support interrupts
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 12 Dec 2019 11:06:40 +0000 (12:06 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Dec 2019 11:50:19 +0000 (12:50 +0100)
commitbff3f51d13c3f41e2ead2cfff5bfe0b8c22ef44a
tree270742ae1fcb55b3fc358f434c4812e0d6c4a023
parentf5eb7daf2087d52e3a55f9c081ff318588e287e8
rtc: extend check for RTCs that don't support interrupts

Several RTCs would only expose the broken behavior on enabling
interrupts. The reason for that is that the kernel only returns the
error if the state changes. Therefore the check has to probe
switch_interrupts(1) as well.

On platforms that work it will be switched on and off, while on those it
never works it will just stay off.

Clocks known to expose that behavior include, but are not limited to:
PPC64# dmesg | grep -i rtc   
[    0.241872] rtc-generic rtc-generic: registered as rtc0
[    0.270221] rtc-generic rtc-generic: setting system clock to ...
ARM64# dmesg | grep -i rtc
[    0.876198] rtc-efi rtc-efi: registered as rtc0
[    1.046869] rtc-efi rtc-efi: setting system clock to ...

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
rtc_linux.c