Skip to content

Commit db6525a

Browse files
Longfang Liuawilliam
authored andcommitted
hisi_acc_vfio_pci: bugfix the problem of uninstalling driver
In a live migration scenario. If the number of VFs at the destination is greater than the source, the recovery operation will fail and qemu will not be able to complete the process and exit after shutting down the device FD. This will cause the driver to be unable to be unloaded normally due to abnormal reference counting of the live migration driver caused by the abnormal closing operation of fd. Therefore, make sure the migration file descriptor references are always released when the device is closed. Fixes: b0eed08 ("hisi_acc_vfio_pci: Add support for VFIO live migration") Signed-off-by: Longfang Liu <liulongfang@huawei.com> Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Link: https://lore.kernel.org/r/20250510081155.55840-5-liulongfang@huawei.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent e63c466 commit db6525a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,7 @@ static void hisi_acc_vfio_pci_close_device(struct vfio_device *core_vdev)
15081508
struct hisi_acc_vf_core_device *hisi_acc_vdev = hisi_acc_get_vf_dev(core_vdev);
15091509
struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm;
15101510

1511+
hisi_acc_vf_disable_fds(hisi_acc_vdev);
15111512
mutex_lock(&hisi_acc_vdev->open_mutex);
15121513
hisi_acc_vdev->dev_opened = false;
15131514
iounmap(vf_qm->io_base);

0 commit comments

Comments
 (0)