diff options
| -rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 43517ce930f2..d0f1e7026d5d 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
| @@ -217,14 +217,8 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) | |||
| 217 | * Try to reset the device. The success of this is dependent on | 217 | * Try to reset the device. The success of this is dependent on |
| 218 | * being able to lock the device, which is not always possible. | 218 | * being able to lock the device, which is not always possible. |
| 219 | */ | 219 | */ |
| 220 | if (vdev->reset_works) { | 220 | if (vdev->reset_works && !pci_try_reset_function(pdev)) |
| 221 | int ret = pci_try_reset_function(pdev); | 221 | vdev->needs_reset = false; |
| 222 | if (ret) | ||
| 223 | pr_warn("%s: Failed to reset device %s (%d)\n", | ||
| 224 | __func__, dev_name(&pdev->dev), ret); | ||
| 225 | else | ||
| 226 | vdev->needs_reset = false; | ||
| 227 | } | ||
| 228 | 222 | ||
| 229 | pci_restore_state(pdev); | 223 | pci_restore_state(pdev); |
| 230 | out: | 224 | out: |
