Skip to content

Commit c5d2754

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info()
The Intel IOMMU driver has already converted to use default domain framework in iommu core. There's no need to find a domain for the device in the domain attaching path. Cleanup that code. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 402e668 commit c5d2754

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

drivers/iommu/intel/iommu.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,6 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25542554
struct device *dev,
25552555
struct dmar_domain *domain)
25562556
{
2557-
struct dmar_domain *found = NULL;
25582557
struct device_domain_info *info;
25592558
unsigned long flags;
25602559
int ret;
@@ -2605,26 +2604,6 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
26052604
}
26062605

26072606
spin_lock_irqsave(&device_domain_lock, flags);
2608-
if (dev)
2609-
found = find_domain(dev);
2610-
2611-
if (!found) {
2612-
struct device_domain_info *info2;
2613-
info2 = dmar_search_domain_by_dev_info(info->segment, info->bus,
2614-
info->devfn);
2615-
if (info2) {
2616-
found = info2->domain;
2617-
info2->dev = dev;
2618-
}
2619-
}
2620-
2621-
if (found) {
2622-
spin_unlock_irqrestore(&device_domain_lock, flags);
2623-
free_devinfo_mem(info);
2624-
/* Caller must free the original domain */
2625-
return found;
2626-
}
2627-
26282607
spin_lock(&iommu->lock);
26292608
ret = domain_attach_iommu(domain, iommu);
26302609
spin_unlock(&iommu->lock);

0 commit comments

Comments
 (0)