Re: [PATCH] vfio/xe: avoid duplicate reset in xe_vfio_pci_reset_done

From: Alex Williamson

Date: Fri Apr 24 2026 - 12:49:16 EST


On Fri, 24 Apr 2026 17:17:19 +0800
zhaoguohan@xxxxxxxxxx wrote:

> From: GuoHan Zhao <zhaoguohan@xxxxxxxxxx>
>
> xe_vfio_pci_reset_done() sets deferred_reset and, when it manages to
> acquire state_mutex itself, hands the cleanup off to
> xe_vfio_pci_state_mutex_unlock().
>
> That helper already clears deferred_reset and runs xe_vfio_pci_reset()
> before dropping the mutex. Calling xe_vfio_pci_reset() again right
> afterwards repeats the reset handling unnecessarily.
>
> Fixes: 1b81ed612e12 ("vfio/xe: Reorganize the init to decouple migration from reset")

Change looks good to me, but the Fixes: attribution is wrong, this has
been present since the original code in 1f5556ec8b9e ("vfio/xe: Add
device specific vfio_pci driver variant for Intel graphics"). Thanks,

Alex


> Signed-off-by: GuoHan Zhao <zhaoguohan@xxxxxxxxxx>
> ---
> drivers/vfio/pci/xe/main.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c
> index 4ecadbbfd86e..cbff5af385ef 100644
> --- a/drivers/vfio/pci/xe/main.c
> +++ b/drivers/vfio/pci/xe/main.c
> @@ -135,8 +135,6 @@ static void xe_vfio_pci_reset_done(struct pci_dev *pdev)
> }
> spin_unlock(&xe_vdev->reset_lock);
> xe_vfio_pci_state_mutex_unlock(xe_vdev);
> -
> - xe_vfio_pci_reset(xe_vdev);
> }
>
> static const struct pci_error_handlers xe_vfio_pci_err_handlers = {