Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: nuvoton: Fix sgpio irq handle error

The generic_handle_domain_irq() function calls irq_resolve_mapping().
Thus delete a duplicative irq_find_mapping() call
so that a stack trace and an RCU stall will be avoided.

Fixes: c4f8457d17ce ("gpio: nuvoton: Add Nuvoton NPCM sgpio driver")
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240506064244.1645922-1-JJLIU0@nuvoton.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Jim Liu and committed by
Bartosz Golaszewski
7f45fe2e 2b5ae9c7

+4 -6
+4 -6
drivers/gpio/gpio-npcm-sgpio.c
··· 434 434 struct gpio_chip *gc = irq_desc_get_handler_data(desc); 435 435 struct irq_chip *ic = irq_desc_get_chip(desc); 436 436 struct npcm_sgpio *gpio = gpiochip_get_data(gc); 437 - unsigned int i, j, girq; 437 + unsigned int i, j; 438 438 unsigned long reg; 439 439 440 440 chained_irq_enter(ic, desc); ··· 443 443 const struct npcm_sgpio_bank *bank = &npcm_sgpio_banks[i]; 444 444 445 445 reg = ioread8(bank_reg(gpio, bank, EVENT_STS)); 446 - for_each_set_bit(j, &reg, 8) { 447 - girq = irq_find_mapping(gc->irq.domain, 448 - i * 8 + gpio->nout_sgpio + j); 449 - generic_handle_domain_irq(gc->irq.domain, girq); 450 - } 446 + for_each_set_bit(j, &reg, 8) 447 + generic_handle_domain_irq(gc->irq.domain, 448 + i * 8 + gpio->nout_sgpio + j); 451 449 } 452 450 453 451 chained_irq_exit(ic, desc);