From b1dea0183f192dc9f67cda13a6c7ad4740400525 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Tue, 11 Nov 2014 17:39:46 -0800 Subject: [PATCH] iommu/arm-smmu: allow DOMAIN_ATTR_COHERENT_HTW_DISABLE to be cleared Currently there's no way to clear DOMAIN_ATTR_COHERENT_HTW_DISABLE=0 if you've ever set it. Fix this. Change-Id: I10d3bb2f72a94b2b91d4a0500e0e2d9462efcf36 Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 8c1f479ddf58..7cbf4b1fa5e9 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2013,6 +2013,9 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain, if (htw_disable) smmu_domain->attributes |= (1 << DOMAIN_ATTR_COHERENT_HTW_DISABLE); + else + smmu_domain->attributes &= + ~(1 << DOMAIN_ATTR_COHERENT_HTW_DISABLE); return 0; } default: