Re: [PATCH 5/5] irqchip/imsic: Use IPI_MAX instead of IMSIC_NR_IPI

Anup Patel <[email protected]>
Newsgroups org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel
Message-ID <CAAhSdy26Nk8zQf-DCFxhZELUWDxLCnyvThyc9P0ROOZRiT2_wA@mail.gmail.com>
On Sun, Aug 16, 2026 at 12:31 PM Guo Ren <[email protected]> wrote:
>
> From: "GUO Ren (XuanTie)" <[email protected]>
>
> 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) <[email protected]>

LGTM.

Reviewed-by: Anup Patel <[email protected]>

Regards,
Anup

> ---
>  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 */
> --
> 2.43.0
>

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.