summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2017-01-19 20:57:50 +0000
committerWill Deacon <will.deacon@arm.com>2017-01-23 11:48:16 +0000
commit544a25d904cab2ae68bd71b334603ec3a49b60dd (patch)
tree0bd7124f745e85fb861c7e3d5cc6c79f8a6e5ed0 /drivers/iommu/iommu.c
parent2b20cbba3390a55c511acba2f0f517dd27a528b2 (diff)
downloadlinux-stable-544a25d904cab2ae68bd71b334603ec3a49b60dd.tar.gz
linux-stable-544a25d904cab2ae68bd71b334603ec3a49b60dd.tar.bz2
linux-stable-544a25d904cab2ae68bd71b334603ec3a49b60dd.zip
iommu: Only map direct mapped regions
As we introduced new reserved region types which do not require mapping, let's make sure we only map direct mapped regions. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com> Tested-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com> Tested-by: Bharat Bhushan <bharat.bhushan@nxp.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 927878d0a612..41c190695749 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -343,6 +343,9 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
start = ALIGN(entry->start, pg_size);
end = ALIGN(entry->start + entry->length, pg_size);
+ if (entry->type != IOMMU_RESV_DIRECT)
+ continue;
+
for (addr = start; addr < end; addr += pg_size) {
phys_addr_t phys_addr;