<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/time, branch v3.4</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/time?h=v3.4</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/time?h=v3.4'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-19T19:27:50Z</updated>
<entry>
<title>tick: Fix the spurious broadcast timer ticks after resume</title>
<updated>2012-04-19T19:27:50Z</updated>
<author>
<name>Suresh Siddha</name>
<email>suresh.b.siddha@intel.com</email>
</author>
<published>2012-04-19T02:27:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a6371f80230eaaafd7eef7efeedaa9509bdc982d'/>
<id>urn:sha1:a6371f80230eaaafd7eef7efeedaa9509bdc982d</id>
<content type='text'>
During resume, tick_resume_broadcast() programs the broadcast timer in
oneshot mode unconditionally. On the platforms where broadcast timer
is not really required, this will generate spurious broadcast timer
ticks upon resume. For example, on the always running apic timer
platforms with HPET, I see spurious hpet tick once every ~5minutes
(which is the 32-bit hpet counter wraparound time).

Similar to boot time, during resume make the oneshot mode setting of
the broadcast clock event device conditional on the state of active
broadcast users.

Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Tested-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Tested-by: svenjoac@gmx.de
Cc: torvalds@linux-foundation.org
Cc: rjw@sisk.pl
Link: http://lkml.kernel.org/r/1334802459.28674.209.camel@sbsiddha-desk.sc.intel.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>tick: Ensure that the broadcast device is initialized</title>
<updated>2012-04-19T19:27:35Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-04-18T15:31:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b9a6a23566960d0dd3f51e2e68b472cd61911078'/>
<id>urn:sha1:b9a6a23566960d0dd3f51e2e68b472cd61911078</id>
<content type='text'>
Santosh found another trap when we avoid to initialize the broadcast
device in the switch_to_oneshot code. The broadcast device might be
still in SHUTDOWN state when we actually need to use it. That
obviously breaks, as set_next_event() is called on a shutdown
device. This did not break on x86, but Suresh analyzed it:

From the review, most likely on Sven's system we are force enabling
the hpet using the pci quirk's method very late. And in this case,
hpet_clockevent (which will be global_clock_event) handler can be
null, specifically as this platform might not be using deeper c-states
and using the reliable APIC timer.

Prior to commit 'fa4da365bc7772c', that handler will be set to
'tick_handle_oneshot_broadcast' when we switch the broadcast timer to
oneshot mode, even though we don't use it. Post commit
'fa4da365bc7772c', we stopped switching the broadcast mode to oneshot
as this is not really needed and his platform's global_clock_event's
handler will remain null. While on my SNB laptop, same is set to
'clockevents_handle_noop' because hpet gets enabled very early. (noop
handler on my platform set when the early enabled hpet timer gets
replaced by the lapic timer).

But the commit 'fa4da365bc7772c' tracked the broadcast timer mode in
the SW as oneshot, even though it didn't touch the HW timer. During
resume however, tick_resume_broadcast() saw the SW broadcast mode as
oneshot and actually programmed the broadcast device also into oneshot
mode. So this triggered the null pointer de-reference after the hpet
wraps around and depending on what the hpet counter is set to. On the
normal platforms where hpet gets enabled early we should be seeing a
spurious interrupt (in my SNB laptop I see one spurious interrupt
after around 5 minutes ;) which is 32-bit hpet counter wraparound
time), but that's a separate issue.

Enforce the mode setting when trying to set an event.

Reported-and-tested-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Cc: torvalds@linux-foundation.org
Cc: svenjoac@gmx.de
Cc: rjw@sisk.pl
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181723350.2542@ionos

</content>
</entry>
<entry>
<title>tick: Fix oneshot broadcast setup really</title>
<updated>2012-04-18T12:00:56Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-04-18T10:08:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b435092f70ec5ebbfb6d075d5bf3c631b49a51de'/>
<id>urn:sha1:b435092f70ec5ebbfb6d075d5bf3c631b49a51de</id>
<content type='text'>
Sven Joachim reported, that suspend/resume on rc3 trips over a NULL
pointer dereference. Linus spotted the clockevent handler being NULL.

commit fa4da365b(clockevents: tTack broadcast device mode change in
tick_broadcast_switch_to_oneshot()) tried to fix a problem with the
broadcast device setup, which was introduced in commit 77b0d60c5(
clockevents: Leave the broadcast device in shutdown mode when not
needed).

The initial commit avoided to set up the broadcast device when no
broadcast request bits were set, but that left the broadcast device
disfunctional. In consequence deep idle states which need the
broadcast device were not woken up.

commit fa4da365b tried to fix that by initializing the state of the
broadcast facility, but that missed the fact, that nothing initializes
the event handler and some other state of the underlying clock event
device.

The fix is to revert both commits and make only the mode setting of
the clock event device conditional on the state of active broadcast
users. 

That initializes everything except the low level device mode, but this
happens when the broadcast functionality is invoked by deep idle.

Reported-and-tested-by: Sven Joachim &lt;svenjoac@gmx.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181205540.2542@ionos

</content>
</entry>
<entry>
<title>clockevents: tTack broadcast device mode change in tick_broadcast_switch_to_oneshot()</title>
<updated>2012-04-10T09:42:07Z</updated>
<author>
<name>Suresh Siddha</name>
<email>suresh.b.siddha@intel.com</email>
</author>
<published>2012-04-09T22:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fa4da365bc7772c2cd6d5405bdf151612455f957'/>
<id>urn:sha1:fa4da365bc7772c2cd6d5405bdf151612455f957</id>
<content type='text'>
In the commit 77b0d60c5adf39c74039e2142a1d3cd1e4d53799,
"clockevents: Leave the broadcast device in shutdown mode when not needed",
we were bailing out too quickly in tick_broadcast_switch_to_oneshot(),
with out tracking the broadcast device mode change to 'TICKDEV_MODE_ONESHOT'.

This breaks the platforms which need broadcast device oneshot services during
deep idle states. tick_broadcast_oneshot_control() thinks that it is
in periodic mode and fails to take proper decisions based on the
CLOCK_EVT_NOTIFY_BROADCAST_[ENTER, EXIT] notifications during deep
idle entry/exit.

Fix this by tracking the broadcast device mode as 'TICKDEV_MODE_ONESHOT',
before leaving the broadcast HW device in shutdown mode if there are no active
requests for the moment.

Reported-and-tested-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Cc: johnstul@us.ibm.com
Link: http://lkml.kernel.org/r/1334011304.12400.81.camel@sbsiddha-desk.sc.intel.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>nohz: Fix stale jiffies update in tick_nohz_restart()</title>
<updated>2012-04-06T11:24:17Z</updated>
<author>
<name>Neal Cardwell</name>
<email>ncardwell@google.com</email>
</author>
<published>2012-03-27T19:09:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f103929f8979d2638e58d7f7fda0beefcb8ee7e'/>
<id>urn:sha1:6f103929f8979d2638e58d7f7fda0beefcb8ee7e</id>
<content type='text'>
Fix tick_nohz_restart() to not use a stale ktime_t "now" value when
calling tick_do_update_jiffies64(now).

If we reach this point in the loop it means that we crossed a tick
boundary since we grabbed the "now" timestamp, so at this point "now"
refers to a time in the old jiffy, so using the old value for "now" is
incorrect, and is likely to give us a stale jiffies value.

In particular, the first time through the loop the
tick_do_update_jiffies64(now) call is always a no-op, since the
caller, tick_nohz_restart_sched_tick(), will have already called
tick_do_update_jiffies64(now) with that "now" value.

Note that tick_nohz_stop_sched_tick() already uses the correct
approach: when we notice we cross a jiffy boundary, grab a new
timestamp with ktime_get(), and *then* update jiffies.

Signed-off-by: Neal Cardwell &lt;ncardwell@google.com&gt;
Cc: Ben Segall &lt;bsegall@google.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1332875377-23014-1-git-send-email-ncardwell@google.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>tick: Document TICK_ONESHOT config option</title>
<updated>2012-03-31T10:45:43Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-03-31T10:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3872c48b14259d8c0a00c9fff06a4a4123f7f4eb'/>
<id>urn:sha1:3872c48b14259d8c0a00c9fff06a4a4123f7f4eb</id>
<content type='text'>
This option has been selected from arch code as it was assumed that
it's necessary to support oneshot mode clockevent devices. But it's
just a core internal helper to compile tick-oneshot.c if NOHZ or
HIG_RES_TIMERS are selected.

Reported-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-03-29T21:16:48Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-29T21:16:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcd550745fc54f789c14e7526e0633222c505faa'/>
<id>urn:sha1:bcd550745fc54f789c14e7526e0633222c505faa</id>
<content type='text'>
Pull timer core updates from Thomas Gleixner.

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  ia64: vsyscall: Add missing paranthesis
  alarmtimer: Don't call rtc_timer_init() when CONFIG_RTC_CLASS=n
  x86: vdso: Put declaration before code
  x86-64: Inline vdso clock_gettime helpers
  x86-64: Simplify and optimize vdso clock_gettime monotonic variants
  kernel-time: fix s/then/than/ spelling errors
  time: remove no_sync_cmos_clock
  time: Avoid scary backtraces when warning of &gt; 11% adj
  alarmtimer: Make sure we initialize the rtctimer
  ntp: Fix leap-second hrtimer livelock
  x86, tsc: Skip refined tsc calibration on systems with reliable TSC
  rtc: Provide flag for rtc devices that don't support UIE
  ia64: vsyscall: Use seqcount instead of seqlock
  x86: vdso: Use seqcount instead of seqlock
  x86: vdso: Remove bogus locking in update_vsyscall_tz()
  time: Remove bogus comments
  time: Fix change_clocksource locking
  time: x86: Fix race switching from vsyscall to non-vsyscall clock
</content>
</entry>
<entry>
<title>alarmtimer: Don't call rtc_timer_init() when CONFIG_RTC_CLASS=n</title>
<updated>2012-03-24T11:46:23Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-03-24T11:46:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c5e14e763046b11dd8bf57b5dc9f3ab444af8e60'/>
<id>urn:sha1:c5e14e763046b11dd8bf57b5dc9f3ab444af8e60</id>
<content type='text'>
rtc_timer_init() is not available when CONFIG_RTC_CLASS=n. Provide a
proper wrapper in the RTC section of alarmtimer.c

Reported-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>kernel-time: fix s/then/than/ spelling errors</title>
<updated>2012-03-23T23:49:21Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2012-03-15T03:28:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=88b28adf6fcdd6d10a1cfc7765bb200d7366a265'/>
<id>urn:sha1:88b28adf6fcdd6d10a1cfc7765bb200d7366a265</id>
<content type='text'>
Use than for comparisons, like more than.

CC: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: remove no_sync_cmos_clock</title>
<updated>2012-03-23T23:25:20Z</updated>
<author>
<name>Cesar Eduardo Barros</name>
<email>cesarb@cesarb.net</email>
</author>
<published>2012-02-11T19:54:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=335dd85895abeca1957d5eaa3013dfe8dc60c7d7'/>
<id>urn:sha1:335dd85895abeca1957d5eaa3013dfe8dc60c7d7</id>
<content type='text'>
Commit 9863c90f682fba34cdc26c3437e8c00da6c83fa4 (x86, vmware: Remove
deprecated VMI kernel support) removed the only place which set
no_sync_cmos_clock. Since that commit, this variable is never set.

Signed-off-by: Cesar Eduardo Barros &lt;cesarb@cesarb.net&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
</feed>
