Skip to content

Commit dfddd54

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu: Remove the assignment of group->domain during default domain alloc
group->domain should only be set once all the device's drivers have had their ops->attach_dev() called. iommu_group_alloc_default_domain() doesn't do this, so it shouldn't set the value. The previous patches organized things so that each caller of iommu_group_alloc_default_domain() follows up with calling __iommu_group_set_domain_internal() that does set the group->domain. Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Niklas Schnelle <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 152431e commit dfddd54

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/iommu/iommu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ int iommu_probe_device(struct device *dev)
435435
* checked.
436436
*/
437437
iommu_alloc_default_domain(group, dev);
438-
group->domain = NULL;
439438
if (group->default_domain) {
440439
iommu_create_device_direct_mappings(group, dev);
441440
ret = __iommu_group_set_domain(group,
@@ -1664,8 +1663,6 @@ static int iommu_group_alloc_default_domain(const struct bus_type *bus,
16641663
return -ENOMEM;
16651664

16661665
group->default_domain = dom;
1667-
if (!group->domain)
1668-
group->domain = dom;
16691666
return 0;
16701667
}
16711668

@@ -1869,7 +1866,6 @@ int bus_iommu_probe(const struct bus_type *bus)
18691866

18701867
iommu_group_create_direct_mappings(group);
18711868

1872-
group->domain = NULL;
18731869
ret = __iommu_group_set_domain(group, group->default_domain);
18741870

18751871
mutex_unlock(&group->mutex);

0 commit comments

Comments
 (0)