iommu/arm-smmu: Fix atomic domain handling

Query if a domain is atomic or not after initializing the
domain, as opposed to before, when the domain properties
have not been finalized.

Change-Id: Ib2f05156268a16cccb410e263de957d9eb2070ae
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Isaac J. Manjarres 2019-11-15 17:10:00 -08:00
commit f785b675ce

View file

@ -2740,8 +2740,6 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
struct iommu_fwspec *fwspec = dev->iommu_fwspec;
struct arm_smmu_device *smmu;
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
bool atomic_domain = test_bit(DOMAIN_ATTR_ATOMIC,
smmu_domain->attributes);
int s1_bypass = 0;
if (!fwspec || fwspec->ops != &arm_smmu_ops.iommu_ops) {
@ -2808,7 +2806,7 @@ out_power_off:
* Keep an additional vote for non-atomic power until domain is
* detached
*/
if (!ret && atomic_domain) {
if (!ret && test_bit(DOMAIN_ATTR_ATOMIC, smmu_domain->attributes)) {
WARN_ON(arm_smmu_power_on(smmu->pwr));
arm_smmu_power_off_atomic(smmu, smmu->pwr);
}