irq: spear-shirq: Fix race in installing chained IRQ handler
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 16 Jun 2015 22:07:01 +0000 (23:07 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jun 2015 12:03:09 +0000 (14:03 +0200)
Fix a race where a pending interrupt could be received and the handler
called before the handler's data has been setup, by converting to
irq_set_chained_handler_and_data().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/E1Z4z0X-0002T1-6U@rmk-PC.arm.linux.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/irqchip/spear-shirq.c

index 9c145a7cb0567479f9fb7e38a0fe2f92f835df96..a45121546caff05acff16beb8d1dd2f4aa0d35c2 100644 (file)
@@ -207,8 +207,7 @@ static void __init spear_shirq_register(struct spear_shirq *shirq,
        if (!shirq->irq_chip)
                return;
 
-       irq_set_chained_handler(parent_irq, shirq_handler);
-       irq_set_handler_data(parent_irq, shirq);
+       irq_set_chained_handler_and_data(parent_irq, shirq_handler, shirq);
 
        for (i = 0; i < shirq->nr_irqs; i++) {
                irq_set_chip_and_handler(shirq->virq_base + i,