Skip to contentSkip to conversation

iommu/vt-d: Detach domain when move device out of group

PATCH In review Lu Baolu 2 participants 2 messages Aug 1, 2019 – Aug 6, 2019 IOMMU

lore
Share & tools
lore

Lu Baolu

author
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Jacob Pan <[email protected]>
Cc Kevin Tian <[email protected]>
Fixes b7297783c2bb6 ("iommu/vt-d: Remove duplicated code for device hotplug")
Reported-and-tested-by Vlad Buslov <[email protected]>
---
 drivers/iommu/intel-iommu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/intel-iommu.c +2 -0
index bdaed2da8a55..3e22fa6ae8c8 100644
@@ -5316,6 +5316,8 @@ static void intel_iommu_remove_device(struct device *dev)
 	if (!iommu)
 		return;
 
+	dmar_remove_one_dev_info(dev);
+
 	iommu_group_remove_device(dev);
 
 	iommu_device_unlink(&iommu->iommu, dev);
Signature · 1 line
2.17.1