mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Reviewed-by: Alex Williamson <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
This commit is contained in:
parent
938c470976
commit
8539c7c16b
2 changed files with 29 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue