mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
gpiolib: irq hooks: fix recursion in gpiochip_irq_unmask
[ Upstream commit9d55221995] irqchip shared with multiple gpiochips, leads to recursive call of gpiochip_irq_mask/gpiochip_irq_unmask which was assigned to rqchip->irq_mask/irqchip->irq_unmask, these happens becouse of only irqchip->irq_enable == gpiochip_irq_enable is checked. Let's add an additional check to make sure shared irqchip is detected even if irqchip->irq_enable wasn't defined. Fixes:a8173820f4("gpio: gpiolib: Allow GPIO IRQs to lazy disable") Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Link: https://lore.kernel.org/r/20201210070514.13238-1-nikita.shubin@maquefel.me Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
78d22dd989
commit
2d9284c188
@@ -1477,7 +1477,8 @@ static void gpiochip_set_irq_hooks(struct gpio_chip *gc)
|
|||||||
if (WARN_ON(gc->irq.irq_enable))
|
if (WARN_ON(gc->irq.irq_enable))
|
||||||
return;
|
return;
|
||||||
/* Check if the irqchip already has this hook... */
|
/* Check if the irqchip already has this hook... */
|
||||||
if (irqchip->irq_enable == gpiochip_irq_enable) {
|
if (irqchip->irq_enable == gpiochip_irq_enable ||
|
||||||
|
irqchip->irq_mask == gpiochip_irq_mask) {
|
||||||
/*
|
/*
|
||||||
* ...and if so, give a gentle warning that this is bad
|
* ...and if so, give a gentle warning that this is bad
|
||||||
* practice.
|
* practice.
|
||||||
|
|||||||
Reference in New Issue
Block a user