[PATCH v2.5/3] iommu/arm-smmu-v3: Undo SMMU enable on probe failure

Robin Murphy robin.murphy at arm.com
Tue Nov 12 06:49:59 PST 2024


If SMMU probe fails afer arm_smmu_device_reset(), we leave the SMMU
enabled with an empty Stream Table, silently blocking all DMA. This
proves rather annoying for debugging said probe failure, so let's handle
it a bit better by putting the SMMU back into (more or less) the same
state as if it hadn't probed at all.

Signed-off-by: Robin Murphy <robin.murphy at arm.com>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
 1 file changed, 1 insertion(+)

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 7908fca962fe..566d66e9c91e 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -4640,6 +4640,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	iommu_device_sysfs_remove(&smmu->iommu);
 free_iopf:
 	iopf_queue_free(smmu->evtq.iopf);
+	arm_smmu_device_disable(smmu);
 	return ret;
 }
 
-- 
2.39.2.101.g768bb238c484.dirty




More information about the linux-arm-kernel mailing list