aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-12-26 06:46:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 05:39:06 -0500
commit0c8033357b1d8fc4bba43cf1f87d2f61f3dd3fd2 (patch)
tree5fe96d3956ecf8d611f64a41a5b8887eebaf2f7b /arch/parisc
parente569eef6298adbcc98ca029cc6763b1d854b1bed (diff)
parisc: Mark cr16 clocksource unstable on SMP systems
commit 41744213602a206f24adcb4a2b7551db3c700e72 upstream. The cr16 interval timer of each CPU is not syncronized to other cr16 timers in other CPUs in a SMP system. So, delay the registration of the cr16 clocksource until all CPUs have been detected and then - if we are on a SMP machine - mark the cr16 clocksource as unstable and lower it's rating before registering it at the clocksource framework. This patch fixes the stalled CPU warnings which we have seen since introduction of the cr16 clocksource. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/time.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 325f30d82b64..47ef8fdcd382 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -289,9 +289,26 @@ void __init time_init(void)
289 289
290 cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */ 290 cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */
291 291
292 /* register at clocksource framework */
293 clocksource_register_hz(&clocksource_cr16, cr16_hz);
294
295 /* register as sched_clock source */ 292 /* register as sched_clock source */
296 sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz); 293 sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz);
297} 294}
295
296static int __init init_cr16_clocksource(void)
297{
298 /*
299 * The cr16 interval timers are not syncronized across CPUs, so mark
300 * them unstable and lower rating on SMP systems.
301 */
302 if (num_online_cpus() > 1) {
303 clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
304 clocksource_cr16.rating = 0;
305 }
306
307 /* register at clocksource framework */
308 clocksource_register_hz(&clocksource_cr16,
309 100 * PAGE0->mem_10msec);
310
311 return 0;
312}
313
314device_initcall(init_cr16_clocksource);