Thread (28 messages) 28 messages, 7 authors, 2017-11-30
STALE3128d

[PATCH] rtc: Allow rtc drivers to specify the tv_nsec value for ntp

From: Alexandre Belloni <hidden>
Date: 2017-11-27 18:48:18

On 23/11/2017 at 16:10:40 +0000, Russell King - ARM Linux wrote:
On Thu, Nov 23, 2017 at 04:36:37PM +0100, Alexandre Belloni wrote:
quoted
On 23/11/2017 at 08:04:39 -0700, Jason Gunthorpe wrote:
quoted
On Thu, Nov 23, 2017 at 10:54:56AM +0100, Alexandre Belloni wrote:
You can't really measure the offset without doing a time set, many
embedded RTCs do not hook up interrupts, etc.
If you don't hook up the interrupt, then all you did is completely
pointless because you will never be able to read the correct time from
the RTC, you'll have up to a 1s offset.
That is incorrect.  The kernel provides emulation for the update
interrupt - it polls the RTC every 1/HZ checking it for a change
in seconds.

So, you end up with up to a 1/HZ offset where no interrupt is
present.
Yes, I forgot about the UIE emulation.
Please don't base your assumptions on the output of hwclock(8) -
the output of that which comes after the timezone specifier is
not documented in the man page, and appears on the face of it to
be rather random:
I'm not basing myself on hwclock's output because it is indeed quite
random.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help