Skip to content

Commit

Permalink
irqchip/riscv-intc: Fix low-level interrupt handler setup for AIA
Browse files Browse the repository at this point in the history
Use riscv_intc_aia_irq() as the low-level interrupt handler instead of the
existing riscv_intc_irq() default handler to make demultiplexing work
correctly.

Also print "using AIA" in the INTC boot banner when AIA is available.

Fixes: 3c46fc5 ("irqchip/riscv-intc: Add support for RISC-V AIA")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240226040746.1396416-2-apatel@ventanamicro.com
  • Loading branch information
Anup Patel authored and Thomas Gleixner committed Feb 27, 2024
1 parent c147e1e commit 678c607
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/irqchip/irq-riscv-intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,20 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn, struct irq_ch
return -ENXIO;
}

rc = set_handle_irq(&riscv_intc_irq);
if (riscv_isa_extension_available(NULL, SxAIA))
rc = set_handle_irq(&riscv_intc_aia_irq);
else
rc = set_handle_irq(&riscv_intc_irq);
if (rc) {
pr_err("failed to set irq handler\n");
return rc;
}

riscv_set_intc_hwnode_fn(riscv_intc_hwnode);

pr_info("%d local interrupts mapped\n",
riscv_isa_extension_available(NULL, SxAIA) ? 64 : riscv_intc_nr_irqs);
pr_info("%d local interrupts mapped%s\n",
riscv_isa_extension_available(NULL, SxAIA) ? 64 : riscv_intc_nr_irqs,
riscv_isa_extension_available(NULL, SxAIA) ? " using AIA" : "");
if (riscv_intc_custom_nr_irqs)
pr_info("%d custom local interrupts mapped\n", riscv_intc_custom_nr_irqs);

Expand Down

0 comments on commit 678c607

Please sign in to comment.