Commit 458b7c8e authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

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: b7297783 ("iommu/vt-d: Remove duplicated code for device hotplug")
Reported-and-tested-by: default avatarVlad Buslov <vladbu@mellanox.com>
Suggested-by: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lkml.org/lkml/2019/7/26/1133Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 11f4fe9b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment