Thread (40 messages) 40 messages, 5 authors, 2021-04-12
STALE1909d
Revisions (2)
  1. rfc [diff vs current]
  2. v1 current

[PATCH v1 08/14] vfio/pci: Notify on device release

From: Alex Williamson <hidden>
Date: 2021-03-08 21:49:53
Also in: lkml
Subsystem: the rest, vfio driver · Maintainers: Linus Torvalds, Alex Williamson

Trigger a release notifier call when open reference count is zero.

Signed-off-by: Alex Williamson <redacted>
---
 drivers/vfio/pci/vfio_pci.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 585895970e9c..bee9318b46ed 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -560,6 +560,7 @@ static void vfio_pci_release(void *device_data)
 	mutex_lock(&vdev->reflck->lock);
 
 	if (!(--vdev->refcnt)) {
+		vfio_device_notifier_call(vdev->device, VFIO_DEVICE_RELEASE);
 		vfio_pci_vf_token_user_add(vdev, -1);
 		vfio_spapr_pci_eeh_release(vdev->pdev);
 		vfio_pci_disable(vdev);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help