All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/2] rtc: Avoid accumulating time drift in suspend/resume
Date: Wed, 01 Jun 2011 18:14:23 -0700	[thread overview]
Message-ID: <1306977263.11492.32.camel@work-vm> (raw)
In-Reply-To: <BANLkTinARof1CUhvRoYC4jQqwAsWOX5PVw@mail.gmail.com>

On Wed, 2011-06-01 at 17:54 -0700, Arve Hjønnevåg wrote:
> On Tue, May 31, 2011 at 11:07 PM, John Stultz <john.stultz@linaro.org> wrote:
> > +       /*
> > +        * Since these RTC suspend/resume handlers are not called
> > +        * at the very end of suspend or the start of resume,
> > +        * some run-time may pass on either sides of the sleep time
> > +        * so subtract kernel run-time between rtc_suspend to rtc_resume
> > +        * to keep things accurate.
> > +        */
> > +       sleep_time = timespec_sub(sleep_time,
> > +                       timespec_sub(new_system, old_system));
> 
> What happens if sleep_time is negative? I think this need to be
> clamped to 0 to avoid backwards jumps when you wake up more than once
> without the rtc advancing.

Good thought! Although that will be easier to catch in
timekeeping_inject_sleeptime(), so I might add it there.

Thanks for the review!
-john




      reply	other threads:[~2011-06-02  1:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  6:07 [RFC][PATCH 0/2] Avoid accumulating drift in suspend/resume John Stultz
2011-06-01  6:07 ` [PATCH 1/2] time: Avoid accumulating time " John Stultz
2011-06-01  6:07 ` [PATCH 2/2] rtc: " John Stultz
2011-06-02  0:54   ` Arve Hjønnevåg
2011-06-02  1:14     ` John Stultz [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=1306977263.11492.32.camel@work-vm \
    --to=john.stultz@linaro.org \
    --cc=arve@android.com \
    --cc=linux-kernel@vger.kernel.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 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.