[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250908163127.2462948-4-maz@kernel.org>
Date: Mon, 8 Sep 2025 17:31:05 +0100
From: Marc Zyngier <maz@...nel.org>
To: linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-acpi@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sven Peter <sven@...nel.org>,
Janne Grunau <j@...nau.net>,
Suzuki K Poulose <suzuki.poulose@....com>,
James Clark <james.clark@...aro.org>
Subject: [PATCH 03/25] of/irq: Add IRQ affinity reporting interface
Plug the irq_populate_fwspec_info() helper into the OF layer
to offer an IRQ affinity reporting function.
Signed-off-by: Marc Zyngier <maz@...nel.org>
---
drivers/of/irq.c | 20 ++++++++++++++++++++
include/linux/of_irq.h | 7 +++++++
2 files changed, 27 insertions(+)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 74aaea61de13c..cb264f44bd6d8 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -479,6 +479,26 @@ int of_irq_get(struct device_node *dev, int index)
}
EXPORT_SYMBOL_GPL(of_irq_get);
+const struct cpumask *of_irq_get_affinity(struct device_node *dev, int index)
+{
+ int rc;
+ struct of_phandle_args oirq;
+ struct irq_fwspec_info info;
+
+ rc = of_irq_parse_one(dev, index, &oirq);
+ if (rc)
+ return NULL;
+
+ of_phandle_args_to_fwspec(oirq.np, oirq.args, oirq.args_count,
+ &info.fwspec);
+
+ if (!irq_populate_fwspec_info(&info) &&
+ info.flags & IRQ_FWSPEC_INFO_AFFINITY_VALID)
+ return info.affinity;
+
+ return NULL;
+}
+
/**
* of_irq_get_byname - Decode a node's IRQ and return it as a Linux IRQ number
* @dev: pointer to device tree node
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index a480063c9cb19..721cbdbc292df 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -43,6 +43,8 @@ extern int of_irq_parse_one(struct device_node *device, int index,
struct of_phandle_args *out_irq);
extern int of_irq_count(struct device_node *dev);
extern int of_irq_get(struct device_node *dev, int index);
+extern const struct cpumask *of_irq_get_affinity(struct device_node *dev,
+ int index);
extern int of_irq_get_byname(struct device_node *dev, const char *name);
extern int of_irq_to_resource_table(struct device_node *dev,
struct resource *res, int nr_irqs);
@@ -77,6 +79,11 @@ static inline int of_irq_get_byname(struct device_node *dev, const char *name)
{
return 0;
}
+static inline const struct cpumask *of_irq_get_affinity(struct device_node *dev,
+ int index)
+{
+ return NULL;
+}
static inline int of_irq_to_resource_table(struct device_node *dev,
struct resource *res, int nr_irqs)
{
--
2.39.2
Powered by blists - more mailing lists