aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/smp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:06:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:06:17 -0400
commit48d554418d3bfbba5e9dc1ebdf352f1b1f3ff4ee (patch)
tree696bdc0c1087e82c6493c852bca514bb0fcd7881 /arch/arm/kernel/smp.c
parentd61b7a572b292e2be409e13b4b3adf475f18fb29 (diff)
parent2cbe23e3a432e3d09a849adb197c8fcc09e7391d (diff)
Merge tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: timer cleanup work" from Arnd Bergmann: "These are split out from the generic soc and driver updates because there was a lot of conflicting work by multiple people. Marc Zyngier worked on simplifying the "localtimer" interfaces, and some of the platforms are touching the same code as they move to device tree based booting. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" * tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (61 commits) ARM: tegra: select USB_ULPI if USB is selected arm/tegra: pcie: fix return value of function ARM: ux500: fix compilation after local timer rework ARM: shmobile: remove additional __io() macro use ARM: local timers: make the runtime registration interface mandatory ARM: local timers: convert MSM to runtime registration interface ARM: local timers: convert exynos to runtime registration interface ARM: smp_twd: remove old local timer interface ARM: imx6q: convert to twd_local_timer_register() interface ARM: highbank: convert to twd_local_timer_register() interface ARM: ux500: convert to twd_local_timer_register() interface ARM: shmobile: convert to twd_local_timer_register() interface ARM: tegra: convert to twd_local_timer_register() interface ARM: plat-versatile: convert to twd_local_timer_register() interface ARM: OMAP4: convert to twd_local_timer_register() interface ARM: smp_twd: add device tree support ARM: smp_twd: add runtime registration support ARM: local timers: introduce a new registration interface ARM: smp_twd: make local_timer_stop a symbol instead of a #define ARM: mach-shmobile: default to no earlytimer ...
Diffstat (limited to 'arch/arm/kernel/smp.c')
-rw-r--r--arch/arm/kernel/smp.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index d616ed51e7a7..8f8cce2c46c4 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -246,6 +246,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
246 store_cpu_topology(cpuid); 246 store_cpu_topology(cpuid);
247} 247}
248 248
249static void percpu_timer_setup(void);
250
249/* 251/*
250 * This is the secondary CPU boot entry. We're using this CPUs 252 * This is the secondary CPU boot entry. We're using this CPUs
251 * idle thread stack, but a set of temporary page tables. 253 * idle thread stack, but a set of temporary page tables.
@@ -452,7 +454,20 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
452 clockevents_register_device(evt); 454 clockevents_register_device(evt);
453} 455}
454 456
455void __cpuinit percpu_timer_setup(void) 457static struct local_timer_ops *lt_ops;
458
459#ifdef CONFIG_LOCAL_TIMERS
460int local_timer_register(struct local_timer_ops *ops)
461{
462 if (lt_ops)
463 return -EBUSY;
464
465 lt_ops = ops;
466 return 0;
467}
468#endif
469
470static void __cpuinit percpu_timer_setup(void)
456{ 471{
457 unsigned int cpu = smp_processor_id(); 472 unsigned int cpu = smp_processor_id();
458 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); 473 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
@@ -460,7 +475,7 @@ void __cpuinit percpu_timer_setup(void)
460 evt->cpumask = cpumask_of(cpu); 475 evt->cpumask = cpumask_of(cpu);
461 evt->broadcast = smp_timer_broadcast; 476 evt->broadcast = smp_timer_broadcast;
462 477
463 if (local_timer_setup(evt)) 478 if (!lt_ops || lt_ops->setup(evt))
464 broadcast_timer_setup(evt); 479 broadcast_timer_setup(evt);
465} 480}
466 481
@@ -475,7 +490,8 @@ static void percpu_timer_stop(void)
475 unsigned int cpu = smp_processor_id(); 490 unsigned int cpu = smp_processor_id();
476 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); 491 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
477 492
478 local_timer_stop(evt); 493 if (lt_ops)
494 lt_ops->stop(evt);
479} 495}
480#endif 496#endif
481 497