Commit 5324fe21 authored by Marc Zyngier's avatar Marc Zyngier Committed by Thomas Gleixner
Browse files

ACPI: irq: Add interrupt affinity reporting interface



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: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarWill Deacon <will@kernel.org>
Reviewed-by: default avatarJonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: default avatarRafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-3-maz@kernel.org
parent 87b0031f
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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
+7 −0
Original line number Diff line number Diff line
@@ -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