lkml.org 
[lkml]   [2017]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Introduce clock precision to help time travelers was Re: Extreme time jitter with suspend/resume cycles
On 18/10/2017 at 23:56:38 +0200, Pavel Machek wrote:
> > Some RTCs will tell you when they lost time/time accuracy and this
> > should be properly reported by the driver. If not, this has to be
> > implemented.
>
> How is it reported to the userspace?
>

Userspace will get -EINVAL when using the RTC_RD_TIME ioctl. The kernel
also get the same error when reading the time from the RTC.

> > For anything else, it is probably the job of userspace to try to be
> > clever.
>
> Userspace would be fine with me, but as far as I can tell, there's no
> good way to do it in userspace.
>
> My proposal would be: kernel keeps accuracy for timeofday.
>
> If RTC says time is bad, accuracy is set to ~0.
>
> settimeofday sets accuracy to 0 (completely accurate).
>
> new_settimeofday gets new argument, accuracy.
>
> new_gettimofday returns accuracy, too.
>
> Does that sound sane? I'm not sure what other interfaces need to be extended.
>
> Best regards,
> Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

\
 
 \ /
  Last update: 2017-11-04 16:35    [W:0.106 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site