* [PATCH v2] gpio: nuvoton: Fix sgpio irq handle error
@ 2024-04-29 6:06 Jim Liu
2024-04-29 6:30 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Jim Liu @ 2024-04-29 6:06 UTC (permalink / raw)
To: KWLIU, JJLIU0, linus.walleij, jim.t90615, brgl
Cc: linux-gpio, linux-kernel, openbmc
User use gpiomon to monitor input pin ,if triger the system will call trace and rcu stall.
The irq_handler uses generic_handle_domain_irq, so there is need to remove irq_find_mapping.
Fixes: c4f8457d17ce ("gpio: nuvoton: Add Nuvoton NPCM sgpio driver")
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
---
Changes for v2:
- add more description
---
drivers/gpio/gpio-npcm-sgpio.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-npcm-sgpio.c b/drivers/gpio/gpio-npcm-sgpio.c
index d31788b43abc..136838c25756 100644
--- a/drivers/gpio/gpio-npcm-sgpio.c
+++ b/drivers/gpio/gpio-npcm-sgpio.c
@@ -443,11 +443,9 @@ static void npcm_sgpio_irq_handler(struct irq_desc *desc)
const struct npcm_sgpio_bank *bank = &npcm_sgpio_banks[i];
reg = ioread8(bank_reg(gpio, bank, EVENT_STS));
- for_each_set_bit(j, ®, 8) {
- girq = irq_find_mapping(gc->irq.domain,
- i * 8 + gpio->nout_sgpio + j);
- generic_handle_domain_irq(gc->irq.domain, girq);
- }
+ for_each_set_bit(j, ®, 8)
+ generic_handle_domain_irq(gc->irq.domain,
+ i * 8 + gpio->nout_sgpio + j);
}
chained_irq_exit(ic, desc);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] gpio: nuvoton: Fix sgpio irq handle error
2024-04-29 6:06 [PATCH v2] gpio: nuvoton: Fix sgpio irq handle error Jim Liu
@ 2024-04-29 6:30 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-04-29 6:30 UTC (permalink / raw)
To: Jim Liu
Cc: KWLIU, JJLIU0, linus.walleij, brgl, linux-gpio, linux-kernel, openbmc
On Mon, Apr 29, 2024 at 02:06:42PM +0800, Jim Liu wrote:
> User use gpiomon to monitor input pin ,if triger the system will call trace and rcu stall.
>
> The irq_handler uses generic_handle_domain_irq, so there is need to remove irq_find_mapping.
>
> Fixes: c4f8457d17ce ("gpio: nuvoton: Add Nuvoton NPCM sgpio driver")
> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> ---
> Changes for v2:
> - add more description
Part of the commit is missing so it will break the build.
drivers/gpio/gpio-npcm-sgpio.c: In function ‘npcm_sgpio_irq_handler’:
drivers/gpio/gpio-npcm-sgpio.c:437:28: warning: unused variable ‘girq’ [-Wunused-variable]
437 | unsigned int i, j, girq;
| ^~~~
Thanks for improving the commit message and adding a Fixes tag. That's
very helpful, but it still can be improved a bit.
======================================
Subject: [PATCH v3] gpio: nuvoton: Fix stall in npcm_sgpio_irq_handler()
The generic_handle_domain_irq() function calls irq_resolve_mapping()
so calling irq_find_mapping() is duplicative and will lead to a stack
trace and an RCU stall.
[ cut and paste the call trace here]
Fixes: c4f8457d17ce ("gpio: nuvoton: Add Nuvoton NPCM sgpio driver")
Signed-off-by:
======================================
Otherwise it looks good. Please fix and resend.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-29 6:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29 6:06 [PATCH v2] gpio: nuvoton: Fix sgpio irq handle error Jim Liu
2024-04-29 6:30 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®