From: John Stultz <john.stultz@linaro.org>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
arnd@arndb.de, tglx@linutronix.de,
linux-tip-commits@vger.kernel.org
Subject: Re: [tip:timers/core] time: Add timekeeping_inject_sleeptime
Date: Fri, 29 Apr 2011 17:24:21 -0700 [thread overview]
Message-ID: <1304123061.30215.38.camel@work-vm> (raw)
In-Reply-To: <BANLkTin12hcs1Q=4E4REdF_-zn08EJXzvw@mail.gmail.com>
On Fri, 2011-04-29 at 16:28 -0700, Arve Hjønnevåg wrote:
> On Fri, Apr 29, 2011 at 10:31 AM, tip-bot for John Stultz
> > @@ -85,15 +82,13 @@ static int rtc_resume(struct device *dev)
> > pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
> > return 0;
> > }
> > + /* calculate the RTC time delta */
> > + set_normalized_timespec(&time, newtime - oldtime, 0);
> >
> > - /* restore wall clock using delta against this RTC;
> > - * adjust again for avg 1/2 second RTC sampling error
> > - */
> > - set_normalized_timespec(&time,
> > - newtime + delta.tv_sec,
> > - (NSEC_PER_SEC >> 1) + delta.tv_nsec);
> > - do_settimeofday(&time);
> > + /* subtract kernel time between rtc_suspend to rtc_resume */
> > + time = timespec_sub(time, timespec_sub(newts, oldts));
>
> The delta you got from the rtc can be almost a second to long or
> short. Do you do anything to prevent these errors from accumulating?
Indeed. Right now we don't do anything.
I'm hoping to extend the RTC interface to provide finer resolution where
possible, but that won't help on hardware that really only gives us
seconds.
We could maybe not only track the suspend time but the RTC time deltas
for when the system is running as well and utilize those values to avoid
accumulating the error long term. But then there can be other
complications between the NTP corrected system time and the uncorrected
RTC time.
Other ideas? I know you've got a patch in the Android tree to try to
address this, should I try to adapt it for use here?
thanks
-john
next prev parent reply other threads:[~2011-04-30 0:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-304529b1b6f8612ccbb4582e997051b48b94f4a4@git.kernel.org>
2011-04-29 23:28 ` [tip:timers/core] time: Add timekeeping_inject_sleeptime Arve Hjønnevåg
2011-04-30 0:23 ` Thomas Gleixner
2011-04-30 1:12 ` Arve Hjønnevåg
2011-04-30 1:57 ` John Stultz
2011-04-30 3:30 ` Arve Hjønnevåg
2011-04-30 0:24 ` John Stultz [this message]
2011-04-30 1:07 ` Arve Hjønnevåg
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=1304123061.30215.38.camel@work-vm \
--to=john.stultz@linaro.org \
--cc=arnd@arndb.de \
--cc=arve@android.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.