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

Jason Gunthorpe jgg at mellanox.com
Thu Nov 23 08:33:14 PST 2017


On Thu, Nov 23, 2017 at 04:36:37PM +0100, Alexandre Belloni wrote:

> It wasn't sent to the RTC ML but that's fine.

Okay, my mistake.

> > Like Russell has said already, the kernel is the only place that could
> > actually have all the information needed. User space would have to use
> > some kind of trail and error approach to figure out what the offset
> > should be.
>
> And I don't see how this is different from doing it in the kernel.

Well, the kernel is closer to the RTC and can issue a single I2C
operation to directly measure bus latency, so it is in a far better
place to do this than user space...

> You currently don't give any feedback loop so the RTC driver doesn't
> know whether it's own offset is correct or not.

Feedback would be very complicated, that seems reasonable to push it
to userspace if people care enough to trim the RTC set very finely.
Allowing userspace to trim set offset from the driver would be
trivial.

Remember, the main goal here is to get bulk accuracy, by supporting
the RTC HW specific offset, which is currently wrong by 0.5s or more
on a lot of RTC hardware.

Jason



More information about the linux-arm-kernel mailing list