[PATCH 5/5] irqchip/imsic: Use IPI_MAX instead of IMSIC_NR_IPI
Radu Rendec
radu at rendec.net
Mon Aug 17 07:25:20 PDT 2026
On Mon, 2026-08-17 at 21:05 +0800, Guo Ren wrote:
> On Sun, Aug 16, 2026 at 11:28 PM Radu Rendec <radu at rendec.net> wrote:
> >
> > On Sun, 2026-08-16 at 07:00 +0000, Guo Ren wrote:
> > > From: "GUO Ren (XuanTie)" <guoren at kernel.org>
> > >
> > > IMSIC was defining its own IMSIC_NR_IPI (= 8) which happened to match
> > > the architecture's IPI_MAX. Now that IPI_MAX is exported from riscv
> > > asm/smp.h, use the architecture constant and drop the private define.
> > >
> > > This keeps the number of multiplexed IPIs in sync with the rest of the
> > > RISC-V IPI infrastructure.
> > >
> > > Signed-off-by: GUO Ren (XuanTie) <guoren at kernel.org>
> > > ---
> > > drivers/irqchip/irq-riscv-imsic-early.c | 4 ++--
> > > drivers/irqchip/irq-riscv-imsic-state.h | 1 -
> > > 2 files changed, 2 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/irqchip/irq-riscv-imsic-early.c b/drivers/irqchip/irq-riscv-imsic-early.c
> > > index 12efd241ce88..823f5f2ecb3d 100644
> > > --- a/drivers/irqchip/irq-riscv-imsic-early.c
> > > +++ b/drivers/irqchip/irq-riscv-imsic-early.c
> > > @@ -67,12 +67,12 @@ static int __init imsic_ipi_domain_init(void)
> > > return 0;
> > >
> > > /* Create IMSIC IPI multiplexing */
> > > - virq = ipi_mux_create(IMSIC_NR_IPI, imsic_ipi_send);
> > > + virq = ipi_mux_create(IPI_MAX, imsic_ipi_send);
> > > if (virq <= 0)
> > > return virq < 0 ? virq : -ENOMEM;
> > >
> > > /* Set vIRQ range */
> > > - riscv_ipi_set_virq_range(virq, IMSIC_NR_IPI);
> > > + riscv_ipi_set_virq_range(virq, IPI_MAX);
> > >
> > > /* Announce that IMSIC is providing IPIs */
> > > pr_info("%pfwP: providing IPIs using interrupt %d\n", imsic->fwnode, IMSIC_IPI_ID);
> > > diff --git a/drivers/irqchip/irq-riscv-imsic-state.h b/drivers/irqchip/irq-riscv-imsic-state.h
> > > index c42ee180b305..878cc192ccec 100644
> > > --- a/drivers/irqchip/irq-riscv-imsic-state.h
> > > +++ b/drivers/irqchip/irq-riscv-imsic-state.h
> > > @@ -13,7 +13,6 @@
> > > #include <linux/timer.h>
> > >
> > > #define IMSIC_IPI_ID 1
> > > -#define IMSIC_NR_IPI 8
> > >
> > > struct imsic_vector {
> > > /* Fixed details of the vector */
> >
> > Reviewed-by: Radu Rendec <radu at rendec.net>
>
> Thanks for the review, Radu. However, this patch depends on [1]. Would
> you mind also reviewing [1]?
>
> [1]: https://lore.kernel.org/linux-riscv/20260816070049.2097442-2-guoren@kernel.org/
You're welcome! Sure, that makes sense, I reviewed [1] as well.
--
Best regards,
Radu
More information about the linux-riscv
mailing list