iommu: Replace __iommu_group_dma_first_attach() with set_domain
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 11 May 2023 04:42:04 +0000 (01:42 -0300)
committerJoerg Roedel <jroedel@suse.de>
Tue, 23 May 2023 06:15:53 +0000 (08:15 +0200)
commitd257344c661950986e6129407f7169f54e0bb4cf
tree2add8b09ec079106511c09306c1eb612b2ce88d2
parent4c8ad9da05662141928fe4ed001d3775fd95221c
iommu: Replace __iommu_group_dma_first_attach() with set_domain

Reorganize the attach_deferred logic to set dev->iommu->attach_deferred
immediately during probe and then have __iommu_device_set_domain() check
it and not attach the default_domain.

This is to prepare for removing the group->domain set from
iommu_group_alloc_default_domain() by calling __iommu_group_set_domain()
to set the group->domain.

Reviewed-by: Lu Baolu <baolu.lu@linux.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/6-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c