Re: [PATCH RFC v2 8/9] iommu/arm-smmu-v3: Add IRQ mapping -EPROBE_DEFER handling
From: Robin Murphy
Date: Fri Dec 04 2026 - 13:59:31 EST
On 30/11/2026 8:54 am, Lorenzo Pieralisi wrote:
With the advent of GICv5, IRQs mapping can fail if the interrupt
controller the wired SMMU interrupts are routed to has not probed
yet when the SMMU driver probes.
Handle -EPROBE_DEFER gracefully for IRQ mappings failures.
Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
---
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Robin Murphy <robin.murphy@xxxxxxx>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 +++++++++++++++++++----------
1 file changed, 28 insertions(+), 15 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 6d4520c47308..602a31ea3bd1 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -5779,13 +5779,26 @@ static struct arm_smmu_device *arm_smmu_impl_probe(struct arm_smmu_device *smmu)
return ERR_PTR(ret);
}
+static int arm_smmu_get_irq(struct platform_device *pdev, const char *name,
+ int *irq_out)
+{
+ int irq = platform_get_irq_byname_optional(pdev, name);
+
+ if (irq == -EPROBE_DEFER)
+ return dev_err_probe(&pdev->dev, irq, "failed to get %s IRQ\n", name);
+ if (irq > 0)
+ *irq_out = irq;
+
+ return 0;
Might it be simpler to just return max(irq,0) by value here? Such that:
smmu->irq = arm_smmu_get_irq(dev, name);
if (smmu->irq < 0) // can only be -EPROBE_DEFER
return smmu->irq;
Or perhaps it's just me and the fact that I'm never particularly fond of output arguments...
Cheers,
Robin.
+}
+
static int arm_smmu_device_probe(struct platform_device *pdev)
{
- int irq, ret;
struct resource *res;
resource_size_t ioaddr;
struct arm_smmu_device *smmu;
struct device *dev = &pdev->dev;
+ int ret;
smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL);
if (!smmu)
@@ -5833,22 +5846,22 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
/* Interrupt lines */
- irq = platform_get_irq_byname_optional(pdev, "combined");
- if (irq > 0)
- smmu->combined_irq = irq;
- else {
- irq = platform_get_irq_byname_optional(pdev, "eventq");
- if (irq > 0)
- smmu->evtq.q.irq = irq;
+ ret = arm_smmu_get_irq(pdev, "combined", &smmu->combined_irq);
+ if (ret)
+ return ret;
- irq = platform_get_irq_byname_optional(pdev, "priq");
- if (irq > 0)
- smmu->priq.q.irq = irq;
-
- irq = platform_get_irq_byname_optional(pdev, "gerror");
- if (irq > 0)
- smmu->gerr_irq = irq;
+ if (!smmu->combined_irq) {
+ ret = arm_smmu_get_irq(pdev, "eventq", &smmu->evtq.q.irq);
+ if (ret)
+ return ret;
+ ret = arm_smmu_get_irq(pdev, "priq", &smmu->priq.q.irq);
+ if (ret)
+ return ret;
+ ret = arm_smmu_get_irq(pdev, "gerror", &smmu->gerr_irq);
+ if (ret)
+ return ret;
}
+
/* Probe the h/w */
ret = arm_smmu_device_hw_probe(smmu);
if (ret)