[Fwd: 11 minute NTP hw clock update racy?]

From: Joakim Tjernlund
Date: Tue Aug 28 2018 - 03:43:39 EST


No luck on linuxppc-dev, trying LKML ...

-------- Forwarded Message --------
From: Joakim Tjernlund <joakim.tjernlund@xxxxxxxxxxxx>
To: linuxppc-dev linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>
Subject: 11 minute NTP hw clock update racy?
Date: Mon, 27 Aug 2018 10:01:12 +0200

We see corrupt HW clock time every now and then(really hard to reproduce)
Our RTC is a DS1388 on an I2C bus.

Looking at ntp_notify_cmos_timer() and it's delayed work queue impl. I wonder
if there could be a race here w.r.t reboot ?

Could the 11 minute update kick in just as the system is about to reset
the CPU?

I am on 4.14.51, ppc32 and using the ppc_md.restart() hook which will
reset the CPU immediately.

Question, is safe to call ntp_notify_cmos_timer() when the work queue is already
armed(like do_adjtimex() does) ?

Jocke