diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-02-14 06:25:58 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-04-27 08:35:32 -0400 |
commit | bfa05f4f3398b61205567f3a5cad90804a5a1fdc (patch) | |
tree | aa1f0e73fea7f29db1e24d1a12ee2fa9124bf922 /arch/arm/kernel | |
parent | 66f75a5d028beaf67c931435fdc3e7823125730c (diff) |
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 <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/smp.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; | |||
454 | #ifdef CONFIG_LOCAL_TIMERS | 454 | #ifdef CONFIG_LOCAL_TIMERS |
455 | int local_timer_register(struct local_timer_ops *ops) | 455 | int local_timer_register(struct local_timer_ops *ops) |
456 | { | 456 | { |
457 | if (!is_smp() || !setup_max_cpus) | ||
458 | return -ENXIO; | ||
459 | |||
457 | if (lt_ops) | 460 | if (lt_ops) |
458 | return -EBUSY; | 461 | return -EBUSY; |
459 | 462 | ||