From: John Stultz <john.stultz@linaro.org>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: linux-kernel@vger.kernel.org,
Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com
Subject: Re: [PATCH] rtc: Fix some bugs that allowed accumulating time drift in suspend/resume
Date: Tue, 22 Nov 2011 18:49:38 -0800 [thread overview]
Message-ID: <1322016578.6445.99.camel@work-vm> (raw)
In-Reply-To: <1322015091-23560-1-git-send-email-arve@android.com>
On Tue, 2011-11-22 at 18:24 -0800, Arve Hjønnevåg wrote:
> The current code checks if abs(delta_delta.tv_sec) is greater or
> equal to two before it discards the old delta value, but this can
> trigger at close to -1 seconds since -1.000000001 seconds is stored
> as tv_sec -2 and tv_nsec 999999999 in a normalized timespec.
>
> rtc_resume had an early return check if the rtc value had not changed
> since rtc_suspend. This effectivly stops time for the duration of the
> short sleep. Check if sleep_time is positive after all the adjustments
> have been applied instead since this allows the old_system adjustment
> in rtc_suspend to have an effect even for short sleep cycles.
>
> Signed-off-by: Arve Hjønnevåg <arve@android.com>
Looks good to me! Thanks for fixing and sending this in!
I'll queue it for upstream.
thanks
-john
prev parent reply other threads:[~2011-11-23 2:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 2:24 [PATCH] rtc: Fix some bugs that allowed accumulating time drift in suspend/resume Arve Hjønnevåg
2011-11-23 2:49 ` 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=1322016578.6445.99.camel@work-vm \
--to=john.stultz@linaro.org \
--cc=a.zummo@towertech.it \
--cc=arve@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/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