[PATCH v2] irqchip/riscv-imsic: Use the global config for ACPI fwnode lookup

Sunil V L sunilvl at oss.qualcomm.com
Mon Nov 30 04:43:20 PST 2026


On Mon, Nov 30, 2026 at 3:12 PM Shankar C <shankar.c at oss.qualcomm.com> wrote:
>
> The IMSIC firmware node is already available through the global
> configuration, so the separate ACPI fwnode pointer duplicates that
> state.
>
 I think "Already” is a bit misleading here and the commit message
needs to describe the change in the
 imperative mood. Something like below would be a better commit message.

Use the fwnode exposed by the global configuration in commit
ff6f8cd2919b ("irqchip/riscv-imsic: Expose the fwnode via the global
config"). Remove the separate ACPI fwnode pointer to avoid duplicating
the reference.

> Signed-off-by: Shankar C <shankar.c at oss.qualcomm.com>
> ---
> Changes in v2:
> - Store the global configuration pointer locally to avoid calling
>   imsic_get_global_config() twice in imsic_acpi_get_fwnode().
>
>  drivers/irqchip/irq-riscv-imsic-early.c | 9 +--------
>  include/linux/irqchip/riscv-imsic.h     | 8 +++++++-
>  2 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/irqchip/irq-riscv-imsic-early.c b/drivers/irqchip/irq-riscv-imsic-early.c
> index 06726a062b75..0fb5484d0cd7 100644
> --- a/drivers/irqchip/irq-riscv-imsic-early.c
> +++ b/drivers/irqchip/irq-riscv-imsic-early.c
> @@ -248,17 +248,10 @@ IRQCHIP_DECLARE(riscv_imsic, "riscv,imsics", imsic_early_dt_init);
>
>  #ifdef CONFIG_ACPI
>
> -static struct fwnode_handle *imsic_acpi_fwnode;
> -
> -struct fwnode_handle *imsic_acpi_get_fwnode(struct device *dev)
> -{
> -       return imsic_acpi_fwnode;
> -}
> -EXPORT_SYMBOL_GPL(imsic_acpi_get_fwnode);
> -
>  static int __init imsic_early_acpi_init(union acpi_subtable_headers *header,
>                                         const unsigned long end)
>  {
> +       struct fwnode_handle *imsic_acpi_fwnode;
>         struct acpi_madt_imsic *imsic = (struct acpi_madt_imsic *)header;
>         int rc;
>
> diff --git a/include/linux/irqchip/riscv-imsic.h b/include/linux/irqchip/riscv-imsic.h
> index b7be1aad7774..886f82e52546 100644
> --- a/include/linux/irqchip/riscv-imsic.h
> +++ b/include/linux/irqchip/riscv-imsic.h
> @@ -96,7 +96,13 @@ static inline const struct imsic_global_config *imsic_get_global_config(void)
>
>  #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_RISCV_IMSIC)
>  int imsic_platform_acpi_probe(struct fwnode_handle *fwnode);
> -struct fwnode_handle *imsic_acpi_get_fwnode(struct device *dev);
> +
> +static inline struct fwnode_handle *imsic_acpi_get_fwnode(struct device *dev)
> +{
> +       const struct imsic_global_config *global = imsic_get_global_config();
> +
> +       return global ? global->fwnode : NULL;
> +}
>  #else
>  static inline struct fwnode_handle *imsic_acpi_get_fwnode(struct device *dev) { return NULL; }
>  #endif
>

Otherwise, LGTM.

Reviewed-by: Sunil V L <sunilvl at oss.qualcomm.com>



More information about the linux-riscv mailing list