Jason Gunthorpe fcbb0a4d73 iommu: Revise iommu_group_alloc_default_domain()
Robin points out that the fallback to guessing what domains the driver
supports should only happen if the driver doesn't return a preference from
its ops->def_domain_type().

Re-organize iommu_group_alloc_default_domain() so it internally uses
iommu_def_domain_type only during the fallback and makes it clearer how
the fallback sequence works.

Make iommu_group_alloc_default_domain() return the domain so the return
based logic is cleaner and to prepare for the next patch.

Remove the iommu_alloc_default_domain() function as it is now trivially
just calling iommu_group_alloc_default_domain().

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/13-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2023-05-23 08:15:56 +02:00
..
2023-05-22 17:38:45 +02:00
2023-05-22 17:38:45 +02:00
2023-05-22 17:38:45 +02:00
2022-09-09 09:26:22 +02:00
2022-11-03 15:47:54 +01:00
2023-04-30 13:00:38 -07:00
2023-03-31 10:03:31 +02:00
2023-02-24 14:34:12 -08:00
2023-02-24 13:40:13 -08:00