public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Zoran Markovic <zoran.markovic@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Feng Tang <feng.tang@intel.com>,
	stable@vger.kernel.org
Subject: Re: [RFC PATCH] timekeeping: Correct run-time detection of real-time clock.
Date: Fri, 17 May 2013 11:39:08 -0700	[thread overview]
Message-ID: <5196794C.2030005@linaro.org> (raw)
In-Reply-To: <1368815045-21209-1-git-send-email-zoran.markovic@linaro.org>

On 05/17/2013 11:24 AM, Zoran Markovic wrote:
> Since commit <31ade30692dc9680bfc95700d794818fa3f754ac>, timekeeping_init()
> checks for presence of persistent clock by attempting to read a non-zero
> time value from real-time clock. This is an issue on platforms where
> persistent_clock (instead of a RTC) is implemented as a free-running counter
> starting from zero on each boot and running during suspend. Examples are some
> ARM platforms (e.g. PandaBoard). An attempt to read such a clock during
> timekeeping_init() may return zero value and falsely declare persistent clock
> as missing. Additionally, in the above case suspend times may be accounted
> twice (once from timekeeping_resume() and once from rtc_resume()), resulting
> in a gradual drift of system time.
>
> This patch does a run-time correction of the issue by doing the same check
> during timekeeping_suspend().
>
> A better long-term solution would have to return error when trying to read
> non-existing clock and zero when trying to read an uninitialized clock, but
> that would require changing all persistent_clock implementations.
>
> This patch addresses the immediate breakage, for now.
>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Feng Tang <feng.tang@intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>

Thanks for finding and sending this out!  I'll queue this for 3.10.

thanks again
-john





  reply	other threads:[~2013-05-17 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17 18:24 [RFC PATCH] timekeeping: Correct run-time detection of real-time clock Zoran Markovic
2013-05-17 18:39 ` John Stultz [this message]
2013-10-12  7:48 ` Feng Tang
2013-10-15 18:23   ` Zoran Markovic

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=5196794C.2030005@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=feng.tang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zoran.markovic@linaro.org \
    /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