diff options
author | Will Deacon <will.deacon@arm.com> | 2014-06-25 07:12:41 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2014-07-03 10:50:22 -0400 |
commit | 9c5c92e35cf5c4f7ee523d62a6bf9d5dc290350b (patch) | |
tree | 977fab969cfe52fb9153c05de21bc6d46d4b8a19 | |
parent | 44680eedf9409daf0fed618ae101f35d1f83d1a4 (diff) |
iommu/arm-smmu: prefer stage-1 mappings where we have a choice
For an SMMU that supports both Stage-1 and Stage-2 mappings (but not
nested translation), then we should prefer stage-1 mappings as we
otherwise rely on the memory attributes of the incoming transactions
for IOMMU_CACHE mappings.
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | drivers/iommu/arm-smmu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 2961b8c474eb..7638b579e08d 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -876,12 +876,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, | |||
876 | */ | 876 | */ |
877 | cfg->cbar = CBAR_TYPE_S1_TRANS_S2_BYPASS; | 877 | cfg->cbar = CBAR_TYPE_S1_TRANS_S2_BYPASS; |
878 | start = smmu->num_s2_context_banks; | 878 | start = smmu->num_s2_context_banks; |
879 | } else if (smmu->features & ARM_SMMU_FEAT_TRANS_S2) { | 879 | } else if (smmu->features & ARM_SMMU_FEAT_TRANS_S1) { |
880 | cfg->cbar = CBAR_TYPE_S2_TRANS; | ||
881 | start = 0; | ||
882 | } else { | ||
883 | cfg->cbar = CBAR_TYPE_S1_TRANS_S2_BYPASS; | 880 | cfg->cbar = CBAR_TYPE_S1_TRANS_S2_BYPASS; |
884 | start = smmu->num_s2_context_banks; | 881 | start = smmu->num_s2_context_banks; |
882 | } else { | ||
883 | cfg->cbar = CBAR_TYPE_S2_TRANS; | ||
884 | start = 0; | ||
885 | } | 885 | } |
886 | 886 | ||
887 | ret = __arm_smmu_alloc_bitmap(smmu->context_map, start, | 887 | ret = __arm_smmu_alloc_bitmap(smmu->context_map, start, |