iommu/arm-smmu: Ensure power resources are enabled during tlb maintenance

arm_smmu_iotlb_sync can be called outside of arm_smmu_unmap, meaning
that the power resources required to access the SMMU register space
may be disabled. Thus, call arm_smmu_power_[on/off] when invoking
arm_smmu_iotlb_sync and arm_smmu_flush_iotlb_all.

Change-Id: I9f6ec0db9b0e25a5c4bf2b0adb3fb950e6843a86
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Isaac J. Manjarres 2020-08-19 14:09:24 -07:00
commit bf4e1bea47

View file

@ -3232,7 +3232,13 @@ static void arm_smmu_flush_iotlb_all(struct iommu_domain *domain)
if (smmu_domain->flush_ops) {
arm_smmu_rpm_get(smmu);
if (arm_smmu_domain_power_on(domain, smmu)) {
WARN_ON(1);
arm_smmu_rpm_put(smmu);
return;
}
smmu_domain->flush_ops->tlb.tlb_ops.tlb_flush_all(smmu_domain);
arm_smmu_domain_power_off(domain, smmu);
arm_smmu_rpm_put(smmu);
}
}
@ -3245,7 +3251,13 @@ static void arm_smmu_iotlb_sync(struct iommu_domain *domain,
if (smmu_domain->flush_ops) {
arm_smmu_rpm_get(smmu);
if (arm_smmu_domain_power_on(domain, smmu)) {
WARN_ON(1);
arm_smmu_rpm_put(smmu);
return;
}
smmu_domain->flush_ops->tlb_sync(smmu_domain);
arm_smmu_domain_power_off(domain, smmu);
arm_smmu_rpm_put(smmu);
}
}