summaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/time.c
diff options
context:
space:
mode:
authorVineet Gupta2016-01-28 08:26:03 +0100
committerVineet Gupta2016-05-09 06:02:28 +0200
commit569579401ae1c9b9f317f38261e32135b153e9b3 (patch)
treefd84b2771fc477193e2fb62cbf0d02bff340e9a8 /arch/arc/kernel/time.c
parentARC: [intc-compact] setup TIMER as percpu_dev (diff)
downloadkernel-qcow2-linux-569579401ae1c9b9f317f38261e32135b153e9b3.tar.gz
kernel-qcow2-linux-569579401ae1c9b9f317f38261e32135b153e9b3.tar.xz
kernel-qcow2-linux-569579401ae1c9b9f317f38261e32135b153e9b3.zip
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.c14
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);
}
/*