Skip to contentSkip to conversation

drm/i915/gvt: Add missing vfio_unregister_group_dev() call

PATCH In review Alex Williamson 2 participants 2 messages Nov 9, 2022 – Nov 11, 2022 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/gvt: Add missing vfio_unregister_group_dev() call

From: Jason Gunthorpe <[email protected]>

[ Upstream commit f423fa1bc9fe1978e6b9f54927411b62cb43eb04 ]

When converting to directly create the vfio_device the mdev driver has to put a vfio_register_emulated_iommu_dev() in the probe() and a pairing vfio_unregister_group_dev() in the remove.

This was missed for gvt, add it.

---
 drivers/gpu/drm/i915/gvt/kvmgt.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/gvt/kvmgt.c +3 -0
index e3cd58946477..de89946c4817 100644
@@ -1595,6 +1595,9 @@ static void intel_vgpu_remove(struct mdev_device *mdev)
 
 	if (WARN_ON_ONCE(vgpu->attached))
 		return;
+
+	vfio_unregister_group_dev(&vgpu->vfio_device);
+	vfio_uninit_group_dev(&vgpu->vfio_device);
 	intel_gvt_destroy_vgpu(vgpu);
 }
 
maintainer
#1 lore raw
Quoted 19 lines · Alex Williamson

From: Jason Gunthorpe <[email protected]>

[ Upstream commit f423fa1bc9fe1978e6b9f54927411b62cb43eb04 ]

When converting to directly create the vfio_device the mdev driver has to put a vfio_register_emulated_iommu_dev() in the probe() and a pairing vfio_unregister_group_dev() in the remove.

This was missed for gvt, add it.

Quoted 6 lines
---
 drivers/gpu/drm/i915/gvt/kvmgt.c |    3 +++
 1 file changed, 3 insertions(+)

Now queued up, thanks.

greg k-h