diff options
Diffstat (limited to 'arch/arc/kernel/irq.c')
-rw-r--r-- | arch/arc/kernel/irq.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 2ee226546c6a..ba17f85285cf 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c | |||
@@ -29,11 +29,11 @@ void __init init_IRQ(void) | |||
29 | 29 | ||
30 | #ifdef CONFIG_SMP | 30 | #ifdef CONFIG_SMP |
31 | /* a SMP H/w block could do IPI IRQ request here */ | 31 | /* a SMP H/w block could do IPI IRQ request here */ |
32 | if (plat_smp_ops.init_irq_cpu) | 32 | if (plat_smp_ops.init_per_cpu) |
33 | plat_smp_ops.init_irq_cpu(smp_processor_id()); | 33 | plat_smp_ops.init_per_cpu(smp_processor_id()); |
34 | 34 | ||
35 | if (machine_desc->init_cpu_smp) | 35 | if (machine_desc->init_per_cpu) |
36 | machine_desc->init_cpu_smp(smp_processor_id()); | 36 | machine_desc->init_per_cpu(smp_processor_id()); |
37 | #endif | 37 | #endif |
38 | } | 38 | } |
39 | 39 | ||
@@ -51,6 +51,18 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
51 | set_irq_regs(old_regs); | 51 | set_irq_regs(old_regs); |
52 | } | 52 | } |
53 | 53 | ||
54 | /* | ||
55 | * API called for requesting percpu interrupts - called by each CPU | ||
56 | * - For boot CPU, actually request the IRQ with genirq core + enables | ||
57 | * - For subsequent callers only enable called locally | ||
58 | * | ||
59 | * Relies on being called by boot cpu first (i.e. request called ahead) of | ||
60 | * any enable as expected by genirq. Hence Suitable only for TIMER, IPI | ||
61 | * which are guaranteed to be setup on boot core first. | ||
62 | * Late probed peripherals such as perf can't use this as there no guarantee | ||
63 | * of being called on boot CPU first. | ||
64 | */ | ||
65 | |||
54 | void arc_request_percpu_irq(int irq, int cpu, | 66 | void arc_request_percpu_irq(int irq, int cpu, |
55 | irqreturn_t (*isr)(int irq, void *dev), | 67 | irqreturn_t (*isr)(int irq, void *dev), |
56 | const char *irq_nm, | 68 | const char *irq_nm, |
@@ -60,14 +72,17 @@ void arc_request_percpu_irq(int irq, int cpu, | |||
60 | if (!cpu) { | 72 | if (!cpu) { |
61 | int rc; | 73 | int rc; |
62 | 74 | ||
75 | #ifdef CONFIG_ISA_ARCOMPACT | ||
63 | /* | 76 | /* |
64 | * These 2 calls are essential to making percpu IRQ APIs work | 77 | * A subsequent request_percpu_irq() fails if percpu_devid is |
65 | * Ideally these details could be hidden in irq chip map function | 78 | * not set. That in turns sets NOAUTOEN, meaning each core needs |
66 | * but the issue is IPIs IRQs being static (non-DT) and platform | 79 | * to call enable_percpu_irq() |
67 | * specific, so we can't identify them there. | 80 | * |
81 | * For ARCv2, this is done in irq map function since we know | ||
82 | * which irqs are strictly per cpu | ||
68 | */ | 83 | */ |
69 | irq_set_percpu_devid(irq); | 84 | irq_set_percpu_devid(irq); |
70 | irq_modify_status(irq, IRQ_NOAUTOEN, 0); /* @irq, @clr, @set */ | 85 | #endif |
71 | 86 | ||
72 | rc = request_percpu_irq(irq, isr, irq_nm, percpu_dev); | 87 | rc = request_percpu_irq(irq, isr, irq_nm, percpu_dev); |
73 | if (rc) | 88 | if (rc) |