aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/arm-smmu.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-04-20 09:53:33 -0400
committerJoerg Roedel <jroedel@suse.de>2016-04-21 10:47:32 -0400
commit9800699c645952da6a7399194d3e762b84cde3cd (patch)
tree14365ce42655652ef3e4a990385745bcce1b91ff /drivers/iommu/arm-smmu.c
parent5f634956cc550768ebd75cf26fdba01044bc600e (diff)
iommu/arm-smmu: Don't allocate resources for bypass domains
Until we get fully plumbed into of_iommu_configure, our default IOMMU_DOMAIN_DMA domains just bypass translation. Since we achieve that by leaving the stream table entries set to bypass instead of pointing at a translation context, the context bank we allocate for the domain is completely wasted. Context banks are typically a rather limited resource, so don't hog ones we don't need. Reported-by: Eric Auger <eric.auger@linaro.org> Tested-by: Eric Auger <eric.auger@linaro.org> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/arm-smmu.c')
-rw-r--r--drivers/iommu/arm-smmu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 5158febd889d..7c39ac4b9c53 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -826,6 +826,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
826 if (smmu_domain->smmu) 826 if (smmu_domain->smmu)
827 goto out_unlock; 827 goto out_unlock;
828 828
829 /* We're bypassing these SIDs, so don't allocate an actual context */
830 if (domain->type == IOMMU_DOMAIN_DMA) {
831 smmu_domain->smmu = smmu;
832 goto out_unlock;
833 }
834
829 /* 835 /*
830 * Mapping the requested stage onto what we support is surprisingly 836 * Mapping the requested stage onto what we support is surprisingly
831 * complicated, mainly because the spec allows S1+S2 SMMUs without 837 * complicated, mainly because the spec allows S1+S2 SMMUs without
@@ -948,7 +954,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
948 void __iomem *cb_base; 954 void __iomem *cb_base;
949 int irq; 955 int irq;
950 956
951 if (!smmu) 957 if (!smmu || domain->type == IOMMU_DOMAIN_DMA)
952 return; 958 return;
953 959
954 /* 960 /*