Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/xe: Notify PF about VF FLR in reset_prepare

Hook into the PCI error handler reset_prepare() callback to notify
the PF about an upcoming VF FLR before reset_done() is executed.
This enables early FLR_PREPARE signaling and ensures that the PF is
aware of the reset before the completion wait begins.

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Alex Williamson <alex@shazbot.org>
Link: https://patch.msgid.link/20260309152449.910636-3-piotr.piorkowski@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>

authored by

Piotr Piórkowski and committed by
Michał Winiarski
9e60ee0e 2de36e3f

+14
+14
drivers/vfio/pci/xe/main.c
··· 85 85 spin_unlock(&xe_vdev->reset_lock); 86 86 } 87 87 88 + static void xe_vfio_pci_reset_prepare(struct pci_dev *pdev) 89 + { 90 + struct xe_vfio_pci_core_device *xe_vdev = pci_get_drvdata(pdev); 91 + int ret; 92 + 93 + if (!pdev->is_virtfn) 94 + return; 95 + 96 + ret = xe_sriov_vfio_flr_prepare(xe_vdev->xe, xe_vdev->vfid); 97 + if (ret) 98 + dev_err(&pdev->dev, "Failed to prepare FLR: %d\n", ret); 99 + } 100 + 88 101 static void xe_vfio_pci_reset_done(struct pci_dev *pdev) 89 102 { 90 103 struct xe_vfio_pci_core_device *xe_vdev = pci_get_drvdata(pdev); ··· 140 127 } 141 128 142 129 static const struct pci_error_handlers xe_vfio_pci_err_handlers = { 130 + .reset_prepare = xe_vfio_pci_reset_prepare, 143 131 .reset_done = xe_vfio_pci_reset_done, 144 132 .error_detected = vfio_pci_core_aer_err_detected, 145 133 };