summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2016-07-05 13:07:53 +0200
committerJoerg Roedel <jroedel@suse.de>2016-07-13 12:46:05 +0200
commit33b21a6b203f70e2012b02753134e59c3ab38779 (patch)
treedee32522644e5dd8b3e2bc52169eae2ea6facf50 /drivers/iommu/iommu.c
parentb548e786ce47017107765bbeb0f100202525ea83 (diff)
downloadlinux-stable-33b21a6b203f70e2012b02753134e59c3ab38779.tar.gz
linux-stable-33b21a6b203f70e2012b02753134e59c3ab38779.tar.bz2
linux-stable-33b21a6b203f70e2012b02753134e59c3ab38779.zip
iommu: Add apply_dm_region call-back to iommu-ops
This new call-back will be used by the iommu driver to do reserve the given dm_region in its iova space before the mapping is created. The call-back is temporary until the dma-ops implementation is part of the common iommu code. Signed-off-by: Joerg Roedel <jroedel@suse.de>
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 3000051f48b4..e8d2fb02d88e 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -348,6 +348,9 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
list_for_each_entry(entry, &mappings, list) {
dma_addr_t start, end, addr;
+ if (domain->ops->apply_dm_region)
+ domain->ops->apply_dm_region(dev, domain, entry);
+
start = ALIGN(entry->start, pg_size);
end = ALIGN(entry->start + entry->length, pg_size);