aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index d1f5caad04f9..5619f264862d 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3869,6 +3869,14 @@ static int device_notifier(struct notifier_block *nb,
3869 action != BUS_NOTIFY_DEL_DEVICE) 3869 action != BUS_NOTIFY_DEL_DEVICE)
3870 return 0; 3870 return 0;
3871 3871
3872 /*
3873 * If the device is still attached to a device driver we can't
3874 * tear down the domain yet as DMA mappings may still be in use.
3875 * Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that.
3876 */
3877 if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL)
3878 return 0;
3879
3872 domain = find_domain(dev); 3880 domain = find_domain(dev);
3873 if (!domain) 3881 if (!domain)
3874 return 0; 3882 return 0;