summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-07-31 23:14:58 -0400
committerJoerg Roedel <jroedel@suse.de>2019-08-06 11:27:10 -0400
commit458b7c8e0dde12d140e3472b80919cbb9ae793f4 (patch)
tree8b8589c883fa46ffa98fb006e6459d81b496d806 /drivers/iommu/intel-iommu.c
parent11f4fe9ba3c85a4efac7ec25e75056a9b612d9da (diff)
iommu/vt-d: Detach domain when move device out of group
When removing a device from an iommu group, the domain should be detached from the device. Otherwise, the stale domain info will still be cached by the driver and the driver will refuse to attach any domain to the device again. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Fixes: b7297783c2bb6 ("iommu/vt-d: Remove duplicated code for device hotplug") Reported-and-tested-by: Vlad Buslov <vladbu@mellanox.com> Suggested-by: Robin Murphy <robin.murphy@arm.com> Link: https://lkml.org/lkml/2019/7/26/1133 Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index bdaed2da8a55..3e22fa6ae8c8 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5316,6 +5316,8 @@ static void intel_iommu_remove_device(struct device *dev)
5316 if (!iommu) 5316 if (!iommu)
5317 return; 5317 return;
5318 5318
5319 dmar_remove_one_dev_info(dev);
5320
5319 iommu_group_remove_device(dev); 5321 iommu_group_remove_device(dev);
5320 5322
5321 iommu_device_unlink(&iommu->iommu, dev); 5323 iommu_device_unlink(&iommu->iommu, dev);