<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/time/timekeeping.c, branch v3.10.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-05-28T20:45:19Z</updated>
<entry>
<title>timekeeping: Correct run-time detection of persistent_clock.</title>
<updated>2013-05-28T20:45:19Z</updated>
<author>
<name>Zoran Markovic</name>
<email>zoran.markovic@linaro.org</email>
</author>
<published>2013-05-17T18:24:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0d6bd9953f739dad96d9a0de65383e479ab4e10d'/>
<id>urn:sha1:0d6bd9953f739dad96d9a0de65383e479ab4e10d</id>
<content type='text'>
Since commit 31ade30692dc9680bfc95700d794818fa3f754ac, timekeeping_init()
checks for presence of persistent clock by attempting to read a non-zero
time value. This is an issue on platforms where persistent_clock (instead
is implemented as a free-running counter (instead of an RTC) 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 &lt;john.stultz@linaro.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Feng Tang &lt;feng.tang@intel.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Zoran Markovic &lt;zoran.markovic@linaro.org&gt;
[jstultz: Tweaked commit message and subject]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Update tk-&gt;cycle_last in resume</title>
<updated>2013-04-22T18:17:51Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-04-22T07:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=77c675ba18836802f6b73d2d773481d06ebc0f04'/>
<id>urn:sha1:77c675ba18836802f6b73d2d773481d06ebc0f04</id>
<content type='text'>
commit 7ec98e15aa (timekeeping: Delay update of clock-&gt;cycle_last)
forgot to update tk-&gt;cycle_last in the resume path. This results in a
stale value versus clock-&gt;cycle_last and prevents resume in the worst
case.

Reported-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-and-tested-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Linux-pm mailing list &lt;linux-pm@lists.linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1304211648150.21884@ionos
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>timekeeping: Make sure to notify hrtimers when TAI offset changes</title>
<updated>2013-04-11T08:19:44Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2013-04-10T19:41:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4e8f8b34b92b6514cc070aeb94d317cadd5071d7'/>
<id>urn:sha1:4e8f8b34b92b6514cc070aeb94d317cadd5071d7</id>
<content type='text'>
Now that we have CLOCK_TAI timers, make sure we notify hrtimer
code when TAI offset is changed.

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Link: http://lkml.kernel.org/r/1365622909-953-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>timekeeping: Shorten seq_count region</title>
<updated>2013-04-04T20:18:32Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-02-21T22:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca4523cda429712fc135c5db50920d90eb776a6c'/>
<id>urn:sha1:ca4523cda429712fc135c5db50920d90eb776a6c</id>
<content type='text'>
Shorten the seqcount write hold region to the actual update of the
timekeeper and the related data (e.g vsyscall).

On a contemporary x86 system this reduces the maximum latencies on
Preempt-RT from 8us to 4us on the non-timekeeping cores.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Implement a shadow timekeeper</title>
<updated>2013-04-04T20:18:32Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-02-21T22:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=48cdc135d4840aab8efd2fc3bacb5d7dfd94a9c8'/>
<id>urn:sha1:48cdc135d4840aab8efd2fc3bacb5d7dfd94a9c8</id>
<content type='text'>
Use the shadow timekeeper to do the update_wall_time() adjustments and
then copy it over to the real timekeeper.

Keep the shadow timekeeper in sync when updating stuff outside of
update_wall_time().

This allows us to limit the timekeeper_seq hold time to the update of
the real timekeeper and the vsyscall data in the next patch.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Delay update of clock-&gt;cycle_last</title>
<updated>2013-04-04T20:18:31Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-02-21T22:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7ec98e15aa049b7a2ca73485f31cf4f90c34e2dd'/>
<id>urn:sha1:7ec98e15aa049b7a2ca73485f31cf4f90c34e2dd</id>
<content type='text'>
For calculating the new timekeeper values store the new cycle_last
value in the timekeeper and update the clock-&gt;cycle_last just when we
actually update the new values.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Store cycle_last value in timekeeper struct as well</title>
<updated>2013-04-04T20:18:31Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-02-21T22:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=14a3b6abe98c8f53a13522610c257accef7321df'/>
<id>urn:sha1:14a3b6abe98c8f53a13522610c257accef7321df</id>
<content type='text'>
For implementing a shadow timekeeper and a split calculation/update
region we need to store the cycle_last value in the timekeeper and
update the value in the clocksource struct only in the update region.

Add the extra storage to the timekeeper.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Simplify tai updating from do_adjtimex</title>
<updated>2013-04-04T20:18:16Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2013-03-22T21:20:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0b5154fb9040cca94e7d9893384c0e78bfe2d296'/>
<id>urn:sha1:0b5154fb9040cca94e7d9893384c0e78bfe2d296</id>
<content type='text'>
Since we are taking the timekeeping locks, just go ahead
and update any tai change directly, rather then dropping
the lock and calling a function that will just take it again.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Hold timekeepering locks in do_adjtimex and hardpps</title>
<updated>2013-04-04T20:18:16Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2013-03-22T18:37:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=06c017fdd4dc48451a29ac37fc1db4a3f86b7f40'/>
<id>urn:sha1:06c017fdd4dc48451a29ac37fc1db4a3f86b7f40</id>
<content type='text'>
In moving the NTP state to be protected by the timekeeping locks,
be sure to acquire the timekeeping locks prior to calling
ntp functions.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Move ADJ_SETOFFSET to top level do_adjtimex()</title>
<updated>2013-04-04T20:18:15Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2013-03-22T22:04:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cef90377fab488bd1f959efda178fb83250cf61d'/>
<id>urn:sha1:cef90377fab488bd1f959efda178fb83250cf61d</id>
<content type='text'>
Since ADJ_SETOFFSET adjusts the timekeeping state, process
it as part of the top level do_adjtimex() function in
timekeeping.c.

This avoids deadlocks that could occur once we change the
ntp locking rules.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
</feed>
