[PATCH RFC 01/11] ACPI: irq: Return -EPROBE_DEFER on missing IRQ domain
From: Lorenzo Pieralisi
Date: Fri Sep 25 2026 - 03:48:44 EST
acpi_register_gsi() might fail if the IRQ domain a GSI belongs to has
not been registered yet by the respective interrupt controller driver.
Return -EPROBE_DEFER in this case so that the mapping can be retried
later by deferring the probe for the driver that requested the IRQ
mapping.
Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
Cc: Marc Zyngier <maz@xxxxxxxxxx>
---
drivers/acpi/irq.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
index e4293458bf61..d1f1938c83bf 100644
--- a/drivers/acpi/irq.c
+++ b/drivers/acpi/irq.c
@@ -52,11 +52,13 @@ EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
* @polarity: polarity of the GSI to be mapped
*
* Returns: a valid linux IRQ number on success
+ * -EPROBE_DEFER when the domain was not yet registered
* -EINVAL on failure
*/
int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
int polarity)
{
+ struct irq_domain *domain;
struct irq_fwspec fwspec;
unsigned int irq;
@@ -66,6 +68,10 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
return -EINVAL;
}
+ domain = irq_find_matching_fwnode(fwspec.fwnode, DOMAIN_BUS_ANY);
+ if (!domain)
+ return -EPROBE_DEFER;
+
fwspec.param[0] = gsi;
fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
fwspec.param_count = 2;
--
2.54.0