[PATCH 1/2] lib: sbi_mpxy: Enable MPXY channel MSI availability determination

Anup Patel apatel at ventanamicro.com
Mon Jun 8 05:28:50 PDT 2026


On Thu, Apr 9, 2026 at 8:27 PM David E. Garcia Porras
<david.garcia at aheadcomputing.com> wrote:
>
> Use imsic_get_data() to determine MSI availability for each MPXY
> channel based on IMSIC presence per hart, instead of unconditionally
> disabling it.
>
> Add a static inline stub for imsic_get_data() when CONFIG_IRQCHIP_IMSIC
> is not enabled.
>
> Signed-off-by: David E. Garcia Porras <david.garcia at aheadcomputing.com>
> ---
>  include/sbi_utils/irqchip/imsic.h | 2 ++
>  lib/sbi/sbi_mpxy.c                | 8 ++++----
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/include/sbi_utils/irqchip/imsic.h b/include/sbi_utils/irqchip/imsic.h
> index 88dd3cfb..68f3c4ad 100644
> --- a/include/sbi_utils/irqchip/imsic.h
> +++ b/include/sbi_utils/irqchip/imsic.h
> @@ -54,6 +54,8 @@ static inline void imsic_local_irqchip_init(void) { }
>
>  static inline int imsic_data_check(struct imsic_data *imsic) { return 0; }
>
> +static inline struct imsic_data *imsic_get_data(u32 hartindex) { return NULL; }
> +
>  #endif
>
>  #endif
> diff --git a/lib/sbi/sbi_mpxy.c b/lib/sbi/sbi_mpxy.c
> index a83cf16c..8ff52bb6 100644
> --- a/lib/sbi/sbi_mpxy.c
> +++ b/lib/sbi/sbi_mpxy.c
> @@ -20,6 +20,7 @@
>  #include <sbi/sbi_bitops.h>
>  #include <sbi/sbi_console.h>
>  #include <sbi/sbi_byteorder.h>
> +#include <sbi_utils/irqchip/imsic.h>
>
>  /** Shared memory size across all harts */
>  static unsigned long mpxy_shmem_size = PAGE_SIZE;
> @@ -255,11 +256,10 @@ static int domain_mpxy_state_data_setup(struct sbi_domain *dom,
>                         return SBI_ENOMEM;
>
>                 /*
> -                * TODO: Proper support for checking msi support from
> -                * platform. Currently disable msi and sse and use
> -                * polling
> +                * TODO: Proper support for checking sse support from
> +                * platform. Currently disable sse and use polling
>                  */
> -               ms->msi_avail = false;
> +               ms->msi_avail = !!imsic_get_data(i);

Instead of directly calling irqchip driver function from sbi_mpxy framework
it is better to check presence of MSI controller through the sbi_irqchip
framework.

I am thinking of extending "struct sbi_irqchip_device" to allow irqchip
drivers advertise capabilities of the interrupt controller (such as wired
irqs, MSIs, etc). Let me take a stab at it.

>                 ms->sse_avail = false;
>
>                 sbi_mpxy_shmem_disable(ms);
> --
> 2.43.0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

Regards,
Anup



More information about the opensbi mailing list