Skip to content

Commit

Permalink
irqchip/realtek-rtl: Service all pending interrupts
Browse files Browse the repository at this point in the history
Instead of only servicing the lowest pending interrupt line, make sure
all pending SoC interrupts are serviced before exiting the chained
handler. This adds a small overhead if only one interrupt is pending,
but should prevent rapid re-triggering of the handler.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/5082ad3cb8b4eedf55075561b93eff6570299fe1.1641739718.git.sander@svanheule.net
  • Loading branch information
Sander Vanheule authored and Marc Zyngier committed Jan 17, 2022
1 parent 91351b5 commit 960dd88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/irqchip/irq-realtek-rtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,20 @@ static void realtek_irq_dispatch(struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
struct irq_domain *domain;
unsigned int pending;
unsigned long pending;
unsigned int soc_int;

chained_irq_enter(chip, desc);
pending = readl(REG(RTL_ICTL_GIMR)) & readl(REG(RTL_ICTL_GISR));

if (unlikely(!pending)) {
spurious_interrupt();
goto out;
}

domain = irq_desc_get_handler_data(desc);
generic_handle_domain_irq(domain, __ffs(pending));
for_each_set_bit(soc_int, &pending, 32)
generic_handle_domain_irq(domain, soc_int);

out:
chained_irq_exit(chip, desc);
Expand Down

0 comments on commit 960dd88

Please sign in to comment.