summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-03-26 13:43:05 +0100
committerJoerg Roedel <jroedel@suse.de>2015-03-31 15:31:49 +0200
commit8539c7c16b970258e14761d8a1f7d10fe798031a (patch)
tree816ddaba62328708e590be824176d17dabad6449 /drivers/iommu/iommu.c
parent938c470976192590b4adc921b2e10fa31237eddc (diff)
downloadtalos-obmc-linux-8539c7c16b970258e14761d8a1f7d10fe798031a.tar.gz
talos-obmc-linux-8539c7c16b970258e14761d8a1f7d10fe798031a.zip
iommu: Introduce iommu domain types
This allows to handle domains differently based on their type in the future. An IOMMU driver can implement certain optimizations for DMA-API domains for example. The domain types can be extended later and some of the existing domain attributes can be migrated to become domain flags. Tested-by: Thierry Reding <treding@nvidia.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 11de2620bbf4..4920605892a3 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -909,14 +909,15 @@ struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
ops = bus->iommu_ops;
if (ops->domain_alloc)
- domain = ops->domain_alloc();
+ domain = ops->domain_alloc(IOMMU_DOMAIN_UNMANAGED);
else
domain = kzalloc(sizeof(*domain), GFP_KERNEL);
if (!domain)
return NULL;
- domain->ops = bus->iommu_ops;
+ domain->ops = bus->iommu_ops;
+ domain->type = IOMMU_DOMAIN_UNMANAGED;
if (ops->domain_init && domain->ops->domain_init(domain))
goto out_free;
OpenPOWER on IntegriCloud