From: Marc Zyngier Date: Tue, 14 Feb 2012 11:25:58 +0000 (+0000) Subject: ARM: local timers: reserve local_timer_register() to SMP X-Git-Tag: firefly_0821_release~3680^2~2860^2~2^2^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bfa05f4f3398b61205567f3a5cad90804a5a1fdc;p=firefly-linux-kernel-4.4.55.git ARM: local timers: reserve local_timer_register() to SMP When running an SMP_ON_UP enabled kernel on UP, or with nosmp passed to the kernel, we want to be able to detect that a local timer is not going to be used (local timers are only used on SMP platforms), so we could register it as a global timer instead. Return -ENXIO when the above case is detected. Signed-off-by: Marc Zyngier --- diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index addbbe8028c2..11c4148b8abb 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -454,6 +454,9 @@ static struct local_timer_ops *lt_ops; #ifdef CONFIG_LOCAL_TIMERS int local_timer_register(struct local_timer_ops *ops) { + if (!is_smp() || !setup_max_cpus) + return -ENXIO; + if (lt_ops) return -EBUSY;