<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/time, branch v4.2-rc4</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.2-rc4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.2-rc4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-07-14T10:01:04Z</updated>
<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>
<entry>
<title>tick/broadcast: Prevent deep idle if no broadcast device available</title>
<updated>2015-07-07T16:46:47Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T14:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b78f3f3c898c824bf56ab55cfa59fc72be49c349'/>
<id>urn:sha1:b78f3f3c898c824bf56ab55cfa59fc72be49c349</id>
<content type='text'>
Add a check for a installed broadcast device to the oneshot control
function and return busy if not.

[ 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>
<entry>
<title>tick/broadcast: Make idle check independent from mode and config</title>
<updated>2015-07-07T16:46:47Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T14:29:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f32dd117051185da6e923b35491a44d7debeeea5'/>
<id>urn:sha1:f32dd117051185da6e923b35491a44d7debeeea5</id>
<content type='text'>
Currently the broadcast busy check, which prevents the idle code from
going into deep idle, works only in one shot mode.

If NOHZ and HIGHRES are off (config or command line) there is no
sanity check at all, so under certain conditions cpus are allowed to
go into deep idle, where the local timer stops, and are not woken up
again because there is no broadcast timer installed or a hrtimer based
broadcast device is not evaluated.

Move tick_broadcast_oneshot_control() into the common code and provide
proper subfunctions for the various config combinations.

The common check in tick_broadcast_oneshot_control() is for the C3STOP
misfeature flag of the local clock event device. If its not set, idle
can proceed. If set, further checks are necessary.

Provide checks for the trivial cases:

 - If broadcast is disabled in the config, then return busy

 - If oneshot mode (NOHZ/HIGHES) is disabled in the config, return
   busy if the broadcast device is hrtimer based.

 - If oneshot mode is enabled in the config call the original
   tick_broadcast_oneshot_control() function. That function needs
   extra checks which will be implemented in seperate patches.

[ 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>
<entry>
<title>tick/broadcast: Sanity check the shutdown of the local clock_event</title>
<updated>2015-07-07T16:46:47Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-07-07T12:07:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0454311903d3fd0f12a86c9e65d7b271c2bb05d'/>
<id>urn:sha1:e0454311903d3fd0f12a86c9e65d7b271c2bb05d</id>
<content type='text'>
The broadcast code shuts down the local clock event unconditionally
even if no broadcast device is installed or if the broadcast device is
hrtimer based.

Add proper sanity checks.

[ 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>
