diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2016-01-28 10:26:03 +0300 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2016-05-09 07:02:28 +0300 |
commit | 569579401ae1c9b9f317f38261e32135b153e9b3 (patch) | |
tree | fd84b2771fc477193e2fb62cbf0d02bff340e9a8 /arch/arc/kernel/time.c | |
parent | db4c4426daedffefcfd890d04a6ec9ed93268878 (diff) | |
download | linux-569579401ae1c9b9f317f38261e32135b153e9b3.tar.xz |
ARC: opencode arc_request_percpu_irq
- The idea is to remove the API usage since it has a subltle
design flaw - relies on being called on cpu0 first. This is true for
some early per cpu irqs such as TIMER/IPI, but not for late probed
per cpu peripherals such a perf. And it's usage in perf has already
bitten us once: see c6317bc7c5ab
("ARCv2: perf: Ensure perf intr gets enabled on all cores") where we
ended up open coding it anyways
- The seeming duplication will go away once we start using cpu notifier
for timer setup
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/time.c')
-rw-r--r-- | arch/arc/kernel/time.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c index 7d9a736fc7e5..146da3cbcc99 100644 --- a/arch/arc/kernel/time.c +++ b/arch/arc/kernel/time.c @@ -251,14 +251,22 @@ void arc_local_timer_setup() { struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device); int cpu = smp_processor_id(); + int irq = TIMER0_IRQ; evt->cpumask = cpumask_of(cpu); clockevents_config_and_register(evt, arc_get_core_freq(), 0, ARC_TIMER_MAX); - /* setup the per-cpu timer IRQ handler - for all cpus */ - arc_request_percpu_irq(TIMER0_IRQ, cpu, timer_irq_handler, - "Timer0 (per-cpu-tick)", evt); + if (!cpu) { + int rc; + + rc = request_percpu_irq(irq, timer_irq_handler, + "Timer0 (per-cpu-tick)", evt); + if (rc) + panic("Percpu IRQ request failed for TIMER\n"); + } + + enable_percpu_irq(irq, 0); } /* |