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 <isaacm@codeaurora.org>
This commit is contained in:
Isaac J. Manjarres 2020-04-07 10:02:12 -07:00
commit 516747fdf7

View file

@ -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;
}