diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2023-06-05 21:59:48 -0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-07-14 16:14:16 +0200 |
commit | f188056352bcdcd4bec31c22baa00ba6568f1416 (patch) | |
tree | c8f0c5dbfe89dfad99da666d67cb201dec0c0d16 /drivers/iommu/dma-iommu.h | |
parent | fa08280364882c42993dc5d8394c467d76803fdb (diff) |
iommu: Avoid locking/unlocking for iommu_probe_device()
Remove the race where a hotplug of a device into an existing group will
have the device installed in the group->devices, but not yet attached to
the group's current domain.
Move the group attachment logic from iommu_probe_device() and put it under
the same mutex that updates the group->devices list so everything is
atomic under the lock.
We retain the two step setup of the default domain for the
bus_iommu_probe() case solely so that we have a more complete view of the
group when creating the default domain for boot time devices. This is not
generally necessary with the current code structure but seems to be
supporting some odd corner cases like alias RID's and IOMMU_RESV_DIRECT or
driver bugs returning different default_domain types for the same group.
During bus_iommu_probe() the group will have a device list but both
group->default_domain and group->domain will be NULL.
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/10-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/dma-iommu.h')
0 files changed, 0 insertions, 0 deletions