From 516747fdf71bcbb282398f8c09e108d2f5a2e177 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 7 Apr 2020 10:02:12 -0700 Subject: [PATCH] iommu/arm-smmu: Fix DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT enablement The functionality provided by DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT can be guaranteed, independent of CONFIG_QCOM_IOMMU_IO_PGTABLE_QUIRKS, so do not guard its enablement with that config. Change-Id: Ifae4280f256b99529ae5a074dbc91b37b5d87e21 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm-smmu.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 4dffea14e0e7..0bb354190e9a 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -3674,22 +3674,18 @@ static int __arm_smmu_domain_set_attr2(struct iommu_domain *domain, case DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT: { int force_coherent = *((int *)data); - if (IS_ENABLED(CONFIG_QCOM_IOMMU_IO_PGTABLE_QUIRKS)) { - if (smmu_domain->smmu != NULL) { - dev_err(smmu_domain->smmu->dev, - "cannot change force coherent attribute while attached\n"); - ret = -EBUSY; - } else if (force_coherent) { - set_bit(DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT, - smmu_domain->attributes); - ret = 0; - } else { - clear_bit(DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT, - smmu_domain->attributes); - ret = 0; - } + if (smmu_domain->smmu != NULL) { + dev_err(smmu_domain->smmu->dev, + "cannot change force coherent attribute while attached\n"); + ret = -EBUSY; + } else if (force_coherent) { + set_bit(DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT, + smmu_domain->attributes); + ret = 0; } else { - ret = -ENOTSUPP; + clear_bit(DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT, + smmu_domain->attributes); + ret = 0; } break; }