Re: [PATCH 1/3] lib: sbi_irqchip: Add irqchip private context pointer in sbi_irqchip_device

Anup Patel
2026-04-07T12:11:48Z

On Thu, Feb 12, 2026 at 3:50 AM Raymond Mao <raymondmaoca@gmail.com> wrote:
>
> From: Raymond Mao <raymond.mao@riscstar.com>
>
> HW specific private data is required for irqchip device operations,
> for example, for APLIC, address, num_idc and num_source are needed
> for mask / unmask / claim an IRQ, thus it is reasonable to add a
> private HW data pointer in sbi_irqchip_device.
>
> Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
> ---
> include/sbi/sbi_irqchip.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/sbi/sbi_irqchip.h b/include/sbi/sbi_irqchip.h
> index 77b54110..af820ec1 100644
> --- a/include/sbi/sbi_irqchip.h
> +++ b/include/sbi/sbi_irqchip.h
> @@ -56,6 +56,9 @@ struct sbi_irqchip_device {
>
> /** Unmask a hardware interrupt of this irqchip */
> void (*hwirq_unmask)(struct sbi_irqchip_device *chip, u32 hwirq);
> +
> + /** Irqchip device private context */
> + void *chip_priv;

No need for this patch since we can use container_of() to
get irqchip device private context.

> };
>
> /**
> --
> 2.25.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

Regards,
Anup