mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] irqchip/riscv-imsic: Use the global config for ACPI fwnode lookup
@ 2026-11-30  9:42 Shankar C
  2026-11-30 12:43 ` Sunil V L
  0 siblings, 1 reply; 2+ messages in thread
From: Shankar C @ 2026-11-30  9:42 UTC (permalink / raw)
  To: anup, tglx, radu, pjw, palmer, aou, alex, sunilvl
  Cc: linux-riscv, linux-kernel, shankar, Shankar C

The IMSIC firmware node is already available through the global
configuration, so the separate ACPI fwnode pointer duplicates that
state.

Signed-off-by: Shankar C <shankar.c@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
-- 
2.47.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] irqchip/riscv-imsic: Use the global config for ACPI fwnode lookup
  2026-11-30  9:42 [PATCH v2] irqchip/riscv-imsic: Use the global config for ACPI fwnode lookup Shankar C
@ 2026-11-30 12:43 ` Sunil V L
  0 siblings, 0 replies; 2+ messages in thread
From: Sunil V L @ 2026-11-30 12:43 UTC (permalink / raw)
  To: Shankar C
  Cc: anup, tglx, radu, pjw, palmer, aou, alex, linux-riscv,
	linux-kernel, shankar

On Mon, Nov 30, 2026 at 3:12 PM Shankar C <shankar.c@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@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@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-30 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30  9:42 [PATCH v2] irqchip/riscv-imsic: Use the global config for ACPI fwnode lookup Shankar C
2026-11-30 12:43 ` Sunil V L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®