mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
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:
parent
a05b67cd45
commit
cb776a03a5
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user