Skip to content
Commit 38c24544 authored by Yi Liu's avatar Yi Liu Committed by Alex Williamson
Browse files

vfio: Move device_del() before waiting for the last vfio_device registration refcount



device_del() destroys the vfio-dev/vfioX under the sysfs for vfio_device.
There is no reason to keep it while the device is going to be unregistered.

This movement is also a preparation for adding vfio_device cdev. Kernel
should remove the cdev node of the vfio_device to avoid new registration
refcount increment while the device is going to be unregistered.

Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Tested-by: default avatarZhenzhong Duan <zhenzhong.duan@intel.com>
Tested-by: default avatarYanting Jiang <yanting.jiang@intel.com>
Signed-off-by: default avatarYi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718135551.6592-18-yi.l.liu@intel.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 291872a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment