]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: irq: Add interrupt affinity reporting interface
authorMarc Zyngier <maz@kernel.org>
Mon, 20 Oct 2025 12:29:19 +0000 (13:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 16:16:32 +0000 (17:16 +0100)
Plug the irq_populate_fwspec_info() helper into the ACPI layer to offer an
interrupt affinity reporting function. This is currently only supported for
the CONFIG_ACPI_GENERIC_GSI configurations, but could later be extended to
legacy architectures if necessary.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Will Deacon <will@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-3-maz@kernel.org
drivers/acpi/irq.c
include/linux/acpi.h

index 76a856c32c4d00f125002371158f84d295cc5abd..d1595156c86a420270b9a470c27e70f20ffd850e 100644 (file)
@@ -300,6 +300,25 @@ int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *res)
 }
 EXPORT_SYMBOL_GPL(acpi_irq_get);
 
+const struct cpumask *acpi_irq_get_affinity(acpi_handle handle,
+                                           unsigned int index)
+{
+       struct irq_fwspec_info info;
+       struct irq_fwspec fwspec;
+       unsigned long flags;
+
+       if (acpi_irq_parse_one(handle, index, &fwspec, &flags))
+               return NULL;
+
+       if (irq_populate_fwspec_info(&fwspec, &info))
+               return NULL;
+
+       if (!(info.flags & IRQ_FWSPEC_INFO_AFFINITY_VALID))
+               return NULL;
+
+       return info.affinity;
+}
+
 /**
  * acpi_set_irq_model - Setup the GSI irqdomain information
  * @model: the value assigned to acpi_irq_model
index 5ff5d99f6ead50e821db4e543c4566c3deb4b573..607db773b6721d13ec0d37209dbccf9994d82902 100644 (file)
@@ -1509,12 +1509,19 @@ static inline int acpi_parse_spcr(bool enable_earlycon, bool enable_console)
 
 #if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI)
 int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *res);
+const struct cpumask *acpi_irq_get_affinity(acpi_handle handle,
+                                           unsigned int index);
 #else
 static inline
 int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *res)
 {
        return -EINVAL;
 }
+static inline const struct cpumask *acpi_irq_get_affinity(acpi_handle handle,
+                                                         unsigned int index)
+{
+       return NULL;
+}
 #endif
 
 #ifdef CONFIG_ACPI_LPIT