mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Gabriel Beddingfield <gabe@nestlabs.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, Guy Erb <guy@nestlabs.com>,
	hharte@nestlabs.com
Subject: Re: Introduce clock precision to help time travelers was Re: Extreme time jitter with suspend/resume cycles
Date: Sat, 4 Nov 2017 16:34:15 +0100	[thread overview]
Message-ID: <20171104153415.bc6ttzfpwkkbbhsr@piout.net> (raw)
In-Reply-To: <20171018215638.GA7487@amd>

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

      reply	other threads:[~2017-11-04 15:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 16:11 Gabriel Beddingfield
2017-10-04 18:22 ` Thomas Gleixner
2017-10-04 23:10   ` Gabriel Beddingfield
2017-10-05  0:20     ` John Stultz
2017-10-05 16:46       ` Gabriel Beddingfield
2017-10-05 11:01     ` Thomas Gleixner
2017-10-05 16:47       ` Gabriel Beddingfield
2017-10-05 18:01         ` Thomas Gleixner
2017-10-05 20:51           ` Gabriel Beddingfield
2017-10-05 21:04             ` Thomas Gleixner
2017-10-05 21:12               ` Gabriel Beddingfield
2017-10-05 21:33               ` Thomas Gleixner
2017-10-05  0:16 ` John Stultz
2017-10-05 11:05   ` Thomas Gleixner
2017-10-05 14:11     ` Thomas Gleixner
2017-10-05 11:08   ` Miroslav Lichvar
2017-10-05 20:14   ` Gabriel Beddingfield
2017-10-05 21:31     ` Thomas Gleixner
2017-10-15  6:39 ` Introduce clock precision to help time travelers was " Pavel Machek
2017-10-18 20:34   ` Alan Cox
2017-10-18 21:08     ` Pavel Machek
2017-10-18 21:26       ` Alexandre Belloni
2017-10-18 21:56         ` Pavel Machek
2017-11-04 15:34           ` Alexandre Belloni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171104153415.bc6ttzfpwkkbbhsr@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=gabe@nestlabs.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=guy@nestlabs.com \
    --cc=hharte@nestlabs.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sboyd@codeaurora.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®