diff options
author | Rich Felker <dalias@libc.org> | 2016-10-13 15:17:41 -0400 |
---|---|---|
committer | Rich Felker <dalias@libc.org> | 2016-10-13 15:17:41 -0400 |
commit | 21c4104d325e4a7ea3f2ea6d33e7c947a14cf8b1 (patch) | |
tree | d25ab1166f2363cc911c807b83cc01d748a5ff9a | |
parent | 03e26780321c28c7d6e72bdd72d8e7066f9b1779 (diff) | |
download | linux-sh-21c4104d325e4a7ea3f2ea6d33e7c947a14cf8b1.tar.gz |
irqchip/jcore: revert to safer fix for percpu irqsdevel-20161012
Signed-off-by: Rich Felker <dalias@libc.org>
-rw-r--r-- | drivers/irqchip/irq-jcore-aic.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/irqchip/irq-jcore-aic.c b/drivers/irqchip/irq-jcore-aic.c index 055fb6f1625f..96bb1181f385 100644 --- a/drivers/irqchip/irq-jcore-aic.c +++ b/drivers/irqchip/irq-jcore-aic.c @@ -25,21 +25,30 @@ static struct irq_chip jcore_aic; +/* + * The J-Core AIC1 and AIC2 are cpu-local interrupt controllers and do + * not distinguish or use distinct irq number ranges for per-cpu event + * interrupts (timer, IPI). Since information to determine whether a + * particular irq number should be treated as per-cpu is not available + * at mapping time, we use a wrapper handler function which chooses + * the right handler at runtime based on whether IRQF_PERCPU was used + * when requesting the irq. + * / + +static void handle_jcore_irq(struct irq_desc *desc) +{ + if (irqd_is_per_cpu(irq_desc_get_irq_data(desc))) + handle_percpu_irq(desc); + else + handle_simple_irq(desc); +} + static int jcore_aic_irqdomain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hwirq) { struct irq_chip *aic = d->host_data; - /* - * For the J-Core AIC1 and AIC2, all irqs behave as percpu. Some - * (timer and IPI) can be generated specifically for individual - * CPUs; the rest are directly connected to a particular CPU. None - * are dynamically routable. Use handle_percpu_irq for all cases, - * since it's necessary for the former and safe (and faster) for - * the latter, and there's no way to distinguish them with the - * information available at mapping time. - */ - irq_set_chip_and_handler(irq, aic, handle_percpu_irq); + irq_set_chip_and_handler(irq, aic, handle_jcore_irq); return 0; } |