From f785b675cecfcdf3df5e3c9841d7be32f4752e63 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Fri, 15 Nov 2019 17:10:00 -0800 Subject: [PATCH] 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 --- drivers/iommu/arm-smmu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 3d32587e28e6..e1653bac1caf 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -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); }