<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/time, branch v4.2.4</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.2.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.2.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-22T21:49:33Z</updated>
<entry>
<title>clocksource: Fix abs() usage w/ 64bit values</title>
<updated>2015-10-22T21:49:33Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2015-09-15T01:05:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=11195a5e5b0665b1cde0c6e629342592240e8ec2'/>
<id>urn:sha1:11195a5e5b0665b1cde0c6e629342592240e8ec2</id>
<content type='text'>
commit 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c upstream.

This patch fixes one cases where abs() was being used with 64-bit
nanosecond values, where the result may be capped at 32-bits.

This potentially could cause watchdog false negatives on 32-bit
systems, so this patch addresses the issue by using abs64().

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/1442279124-7309-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64()</title>
<updated>2015-10-22T21:49:14Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2015-09-09T23:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6402e4ecf0d9a3ec9ceee9d218dcc7605611df7'/>
<id>urn:sha1:d6402e4ecf0d9a3ec9ceee9d218dcc7605611df7</id>
<content type='text'>
commit 2619d7e9c92d524cb155ec89fd72875321512e5b upstream.

The internal clocksteering done for fine-grained error
correction uses a logarithmic approximation, so any time
adjtimex() adjusts the clock steering, timekeeping_freqadjust()
quickly approximates the correct clock frequency over a series
of ticks.

Unfortunately, the logic in timekeeping_freqadjust(), introduced
in commit:

  dc491596f639 ("timekeeping: Rework frequency adjustments to work better w/ nohz")

used the abs() function with a s64 error value to calculate the
size of the approximated adjustment to be made.

Per include/linux/kernel.h:

  "abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()".

Thus on 32-bit platforms, this resulted in the clocksteering to
take a quite dampended random walk trying to converge on the
proper frequency, which caused the adjustments to be made much
slower then intended (most easily observed when large
adjustments are made).

This patch fixes the issue by using abs64() instead.

Reported-by: Nuno Gonçalves &lt;nunojpg@gmail.com&gt;
Tested-by: Nuno Goncalves &lt;nunojpg@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Miroslav Lichvar &lt;mlichvar@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1441840051-20244-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>timer: Write timer-&gt;flags atomically</title>
<updated>2015-08-18T13:31:16Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-08-17T17:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d0023a1448abdcc892b8bca631e74bb1888efd02'/>
<id>urn:sha1:d0023a1448abdcc892b8bca631e74bb1888efd02</id>
<content type='text'>
lock_timer_base() cannot prevent the following :

CPU1 ( in __mod_timer()
timer-&gt;flags |= TIMER_MIGRATING;
spin_unlock(&amp;base-&gt;lock);
base = new_base;
spin_lock(&amp;base-&gt;lock);
// The next line clears TIMER_MIGRATING
timer-&gt;flags &amp;= ~TIMER_BASEMASK;
                                  CPU2 (in lock_timer_base())
                                  see timer base is cpu0 base
                                  spin_lock_irqsave(&amp;base-&gt;lock, *flags);
                                  if (timer-&gt;flags == tf)
                                       return base; // oops, wrong base
timer-&gt;flags |= base-&gt;cpu // too late

We must write timer-&gt;flags in one go, otherwise we can fool other cpus.

Fixes: bc7a34b8b9eb ("timer: Reduce timer migration overhead if disabled")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Jon Christopherson &lt;jon@jons.org&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: xen-devel@lists.xen.org
Cc: david.vrabel@citrix.com
Cc: Sander Eikelenboom &lt;linux@eikelenboom.it&gt;
Link: http://lkml.kernel.org/r/1439831928.32680.11.camel@edumazet-glaptop2.roam.corp.google.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>tick: Move the export of tick_broadcast_oneshot_control to the proper place</title>
<updated>2015-07-14T10:01:04Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-14T10:01:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0f44705175347ec96935d60b765b5d14ecc763bb'/>
<id>urn:sha1:0f44705175347ec96935d60b765b5d14ecc763bb</id>
<content type='text'>
tick_broadcast_oneshot_control got moved from tick-broadcast to
tick-common, but the export stayed in the old place. Fix it up.

Fixes: f32dd1170511 'tick/broadcast: Make idle check independent from mode and config'
Reported-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>tick/broadcast: Prevent NULL pointer dereference</title>
<updated>2015-07-11T12:26:34Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-11T12:26:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c4d029f2d43b39de7b9299e8b58102a442ba86f8'/>
<id>urn:sha1:c4d029f2d43b39de7b9299e8b58102a442ba86f8</id>
<content type='text'>
Dan reported that the recent changes to the broadcast code introduced
a potential NULL dereference.

Add the proper check.

Fixes: e0454311903d "tick/broadcast: Sanity check the shutdown of the local clock_event"
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>tick/broadcast: Handle spurious interrupts gracefully</title>
<updated>2015-07-07T16:46:48Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-05T20:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c4288334818c81c946acb23d2319881f58c3d497'/>
<id>urn:sha1:c4288334818c81c946acb23d2319881f58c3d497</id>
<content type='text'>
Andriy reported that on a virtual machine the warning about negative
expiry time in the clock events programming code triggered:

hpet: hpet0 irq 40 for MSI
hpet: hpet1 irq 41 for MSI
Switching to clocksource hpet
WARNING: at kernel/time/clockevents.c:239

[&lt;ffffffff810ce6eb&gt;] clockevents_program_event+0xdb/0xf0
[&lt;ffffffff810cf211&gt;] tick_handle_periodic_broadcast+0x41/0x50
[&lt;ffffffff81016525&gt;] timer_interrupt+0x15/0x20

When the second hpet is installed as a per cpu timer the broadcast
event is not longer required and stopped, which sets the next_evt of
the broadcast device to KTIME_MAX.

If after that a spurious interrupt happens on the broadcast device,
then the current code blindly handles it and tries to reprogram the
broadcast device afterwards, which adds the period to
next_evt. KTIME_MAX + period results in a negative expiry value
causing the WARN_ON in the clockevents code to trigger.

Add a proper check for the state of the broadcast device into the
interrupt handler and return if the interrupt is spurious.

[ Folded in pointer fix from Sudeep ]

Reported-by: Andriy Gapon &lt;avg@FreeBSD.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/20150705205221.802094647@linutronix.de
</content>
</entry>
<entry>
<title>tick/broadcast: Check for hrtimer broadcast active early</title>
<updated>2015-07-07T16:46:48Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T14:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5113e13a550bc9c2b53cc9944b8a06453c4a0a1'/>
<id>urn:sha1:d5113e13a550bc9c2b53cc9944b8a06453c4a0a1</id>
<content type='text'>
If the current cpu is the one which has the hrtimer based broadcast
queued then we better return busy immediately instead of going through
loops and hoops to figure that out.

[ Split out from a larger combo patch ]

Tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Suzuki Poulose &lt;Suzuki.Poulose@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;Lorenzo.Pieralisi@arm.com&gt;
Cc: Catalin Marinas &lt;Catalin.Marinas@arm.com&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
</content>
</entry>
<entry>
<title>tick/broadcast: Return busy when IPI is pending</title>
<updated>2015-07-07T16:46:48Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T14:45:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0cc5281aa592d0020868f6ccaed359b4ad7b2684'/>
<id>urn:sha1:0cc5281aa592d0020868f6ccaed359b4ad7b2684</id>
<content type='text'>
Tell the idle code not to go deep if the broadcast IPI is about to
arrive.

[ Split out from a larger combo patch ]

Tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Suzuki Poulose &lt;Suzuki.Poulose@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;Lorenzo.Pieralisi@arm.com&gt;
Cc: Catalin Marinas &lt;Catalin.Marinas@arm.com&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
</content>
</entry>
<entry>
<title>tick/broadcast: Return busy if periodic mode and hrtimer broadcast</title>
<updated>2015-07-07T16:46:48Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T15:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d33257264b0267a8fd20f6717abbb484c9e21130'/>
<id>urn:sha1:d33257264b0267a8fd20f6717abbb484c9e21130</id>
<content type='text'>
If the system is in periodic mode and the broadcast device is hrtimer
based, return busy as we have no proper handling for this.

[ Split out from a larger combo patch ]

Tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Suzuki Poulose &lt;Suzuki.Poulose@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;Lorenzo.Pieralisi@arm.com&gt;
Cc: Catalin Marinas &lt;Catalin.Marinas@arm.com&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
</content>
</entry>
<entry>
<title>tick/broadcast: Move the check for periodic mode inside state handling</title>
<updated>2015-07-07T16:46:47Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T14:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e3ac79e087ffe8a1f953ed44a74acf7616cb0b25'/>
<id>urn:sha1:e3ac79e087ffe8a1f953ed44a74acf7616cb0b25</id>
<content type='text'>
We need to check more than the periodic mode for proper operation in
all runtime combinations. To avoid code duplication move the check
into the enter state handling.

No functional change.

[ Split out from a larger combo patch ]

Reported-and-tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Suzuki Poulose &lt;Suzuki.Poulose@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;Lorenzo.Pieralisi@arm.com&gt;
Cc: Catalin Marinas &lt;Catalin.Marinas@arm.com&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Preeti U Murthy &lt;preeti@linux.vnet.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1507070929360.3916@nanos
</content>
</entry>
</feed>
