gpio: mlxbf2: Use generic_handle_irq_safe()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 19 Sep 2022 12:45:18 +0000 (14:45 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Sep 2022 13:08:38 +0000 (15:08 +0200)
On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force
threaded and runs with interrupts enabled. The invocation of
generic_handle_irq() with interrupts enabled triggers a lockdep warning due
to a non-irq safe lock acquisition.

Instead of disabling interrupts on the driver level, use
generic_handle_domain_irq_safe().

[ tglx: Split out from combo patch ]

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de
drivers/gpio/gpio-mlxbf2.c

index 64cb060d9d7533195042102aa38fda72dcfeb2d5..77a41151c921bd790bab6a99363408f385ff864d 100644 (file)
@@ -273,10 +273,8 @@ static irqreturn_t mlxbf2_gpio_irq_handler(int irq, void *ptr)
        pending = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_CAUSE_EVTEN0);
        writel(pending, gs->gpio_io + YU_GPIO_CAUSE_OR_CLRCAUSE);
 
-       for_each_set_bit(level, &pending, gc->ngpio) {
-               int gpio_irq = irq_find_mapping(gc->irq.domain, level);
-               generic_handle_irq(gpio_irq);
-       }
+       for_each_set_bit(level, &pending, gc->ngpio)
+               generic_handle_domain_irq_safe(gc->irq.domain, level);
 
        return IRQ_RETVAL(pending);
 }