]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hisi_acc_vfio_pci: resolve duplicate migration states
authorLongfang Liu <liulongfang@huawei.com>
Thu, 22 Jan 2026 02:02:04 +0000 (10:02 +0800)
committerAlex Williamson <alex@shazbot.org>
Thu, 29 Jan 2026 21:11:00 +0000 (14:11 -0700)
In special scenarios involving duplicate migrations, after the
first migration is completed, if the original VF device is used
again and then migrated to another destination, the state indicating
data migration completion for the VF device is not reset.
This results in the second migration to the destination being skipped
without performing data migration.
After the modification, it ensures that a complete data migration
is performed after the subsequent migration.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Link: https://lore.kernel.org/r/20260122020205.2884497-4-liulongfang@huawei.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c

index c69caef2e9100cb300316f25c415ae6cc0e32546..483381189579cf332723c5bd0a01e8248acb0c64 100644 (file)
@@ -1569,6 +1569,7 @@ static int hisi_acc_vfio_pci_open_device(struct vfio_device *core_vdev)
                }
                hisi_acc_vdev->mig_state = VFIO_DEVICE_STATE_RUNNING;
                hisi_acc_vdev->dev_opened = true;
+               hisi_acc_vdev->match_done = 0;
                mutex_unlock(&hisi_acc_vdev->open_mutex);
        }