Skip to content

Commit f8415f2

Browse files
avpatelMarc Zyngier
authored andcommitted
irqchip/riscv-intc: Add empty irq_eoi() for chained irq handlers
We add empty irq_eoi() in RISC-V INTC driver for child irqchip drivers (such as PLIC, SBI IPI, CLINT, APLIC, IMSIC, etc) which implement chained handlers for parent per-HART local interrupts. This hels us avoid unnecessary mask/unmask of per-HART local interrupts at the time of handling interrupts. Signed-off-by: Anup Patel <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6279228 commit f8415f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/irqchip/irq-riscv-intc.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,27 @@ static void riscv_intc_irq_unmask(struct irq_data *d)
4646
csr_set(CSR_IE, BIT(d->hwirq));
4747
}
4848

49+
static void riscv_intc_irq_eoi(struct irq_data *d)
50+
{
51+
/*
52+
* The RISC-V INTC driver uses handle_percpu_devid_irq() flow
53+
* for the per-HART local interrupts and child irqchip drivers
54+
* (such as PLIC, SBI IPI, CLINT, APLIC, IMSIC, etc) implement
55+
* chained handlers for the per-HART local interrupts.
56+
*
57+
* In the absence of irq_eoi(), the chained_irq_enter() and
58+
* chained_irq_exit() functions (used by child irqchip drivers)
59+
* will do unnecessary mask/unmask of per-HART local interrupts
60+
* at the time of handling interrupts. To avoid this, we provide
61+
* an empty irq_eoi() callback for RISC-V INTC irqchip.
62+
*/
63+
}
64+
4965
static struct irq_chip riscv_intc_chip = {
5066
.name = "RISC-V INTC",
5167
.irq_mask = riscv_intc_irq_mask,
5268
.irq_unmask = riscv_intc_irq_unmask,
69+
.irq_eoi = riscv_intc_irq_eoi,
5370
};
5471

5572
static int riscv_intc_domain_map(struct irq_domain *d, unsigned int irq,

0 commit comments

Comments
 (0)