iommu/qcom: Enable clocks before hardware access in qcom_iommu_ctx_probe()

qcom_iommu_ctx_probe() reads and writes the CB_FSR register to clear any
stale IRQ left by the bootloader. This happens during
devm_of_platform_populate() which is called from the parent device's
probe before any pm_runtime_get(). The parent's clocks (iface, bus, tbu)
are therefore not guaranteed to be on, making the register access
unreliable on rebind or after a suspend cycle.

Use pm_runtime_resume_and_get() on the parent device to ensure clocks
are enabled before the register access, and release the reference
immediately after.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Mukesh Ojha 2026-07-17 20:16:08 +05:30 committed by Will Deacon
parent a05b67cd45
commit cb776a03a5

View File

@ -704,8 +704,13 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
/* clear IRQs before registering fault handler, just in case the
* boot-loader left us a surprise:
*/
if (!ctx->secured_ctx)
if (!ctx->secured_ctx) {
ret = pm_runtime_resume_and_get(dev->parent);
if (ret)
return ret;
iommu_writel(ctx, ARM_SMMU_CB_FSR, iommu_readl(ctx, ARM_SMMU_CB_FSR));
pm_runtime_put_sync(dev->parent);
}
ret = devm_request_irq(dev, irq,
qcom_iommu_fault,