[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 6/8] vfio_pci: fix a wrong check in vfio_pci_reset
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC v2 6/8] vfio_pci: fix a wrong check in vfio_pci_reset |
Date: |
Wed, 28 Jan 2015 16:37:26 +0800 |
when vfio device support FLR, then when device reset,
we call VFIO_DEVICE_RESET ioctl to reset the device first,
at kernel side, we also can see the order of reset:
3330 rc = pcie_flr(dev, probe);
3331 if (rc != -ENOTTY)
3332 goto done;
3333
3334 rc = pci_af_flr(dev, probe);
3335 if (rc != -ENOTTY)
3336 goto done;
3337
3338 rc = pci_pm_reset(dev, probe);
3339 if (rc != -ENOTTY)
3340 goto done;
so when vfio has FLR, reset it directly.
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 8c81bb3..54eb6b4 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3455,7 +3455,7 @@ static void vfio_pci_reset(DeviceState *dev)
vfio_pci_pre_reset(vdev);
if (vdev->vbasedev.reset_works &&
- (vdev->has_flr || !vdev->has_pm_reset) &&
+ vdev->has_flr &&
!ioctl(vdev->vbasedev.fd, VFIO_DEVICE_RESET)) {
trace_vfio_pci_reset_flr(vdev->vbasedev.name);
goto post_reset;
--
1.9.3
- [Qemu-devel] [RFC v2 0/8] pass aer error to guest for vfio device, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 3/8] pcie_aer: expose pcie_aer_msg() interface, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 2/8] vfio-pci: add aer capability support, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 4/8] vfio-pci: pass the aer error to guest, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 6/8] vfio_pci: fix a wrong check in vfio_pci_reset,
Chen Fan <=
- [Qemu-devel] [RFC v2 1/8] pcie_aer: fix typos in pcie_aer_inject_error comment, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 5/8] pcie_aer: fix a trivial typo in PCIEAERMsg comments, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 7/8] vfio_pci: change vfio device features bit macro to enum definition, Chen Fan, 2015/01/28
- [Qemu-devel] [RFC v2 8/8] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature, Chen Fan, 2015/01/28