Skip to content

Commit 6698a71

Browse files
committed
Merge tag 'iommu-fix-v5.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu fix from Joerg Roedel: "Revert a commit from the previous pile of fixes which causes new lockdep splats. It is better to revert it for now and work on a better and more well tested fix" * tag 'iommu-fix-v5.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: Revert "iommu/vt-d: Fix lock inversion between iommu->lock and device_domain_lock"
2 parents b253d5f + 0aafc8a commit 6698a71

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,7 +2504,6 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25042504
}
25052505
}
25062506

2507-
spin_lock(&iommu->lock);
25082507
spin_lock_irqsave(&device_domain_lock, flags);
25092508
if (dev)
25102509
found = find_domain(dev);
@@ -2520,16 +2519,17 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25202519

25212520
if (found) {
25222521
spin_unlock_irqrestore(&device_domain_lock, flags);
2523-
spin_unlock(&iommu->lock);
25242522
free_devinfo_mem(info);
25252523
/* Caller must free the original domain */
25262524
return found;
25272525
}
25282526

2527+
spin_lock(&iommu->lock);
25292528
ret = domain_attach_iommu(domain, iommu);
2529+
spin_unlock(&iommu->lock);
2530+
25302531
if (ret) {
25312532
spin_unlock_irqrestore(&device_domain_lock, flags);
2532-
spin_unlock(&iommu->lock);
25332533
free_devinfo_mem(info);
25342534
return NULL;
25352535
}
@@ -2539,7 +2539,6 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25392539
if (dev)
25402540
dev->archdata.iommu = info;
25412541
spin_unlock_irqrestore(&device_domain_lock, flags);
2542-
spin_unlock(&iommu->lock);
25432542

25442543
/* PASID table is mandatory for a PCI device in scalable mode. */
25452544
if (dev && dev_is_pci(dev) && sm_supported(iommu)) {

0 commit comments

Comments
 (0)