diff options
-rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 3fa20e95a6bb..5f739df91963 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -51,7 +51,7 @@ module_param(disable_vga, bool, S_IRUGO); MODULE_PARM_DESC(disable_vga, "Disable VGA resource access through vfio-pci"); #endif -static bool disable_idle_d3; +static bool disable_idle_d3 = true; module_param(disable_idle_d3, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(disable_idle_d3, "Disable using the PCI D3 low power state for idle, unused devices"); @@ -276,6 +276,10 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) if (ret) return ret; + pci_set_master(pdev); + +#if 0 + /* If reset fails because of the device lock, fail this path entirely */ ret = pci_try_reset_function(pdev); if (ret == -EAGAIN) { @@ -361,7 +365,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) goto disable_exit; } } - +#endif vfio_pci_probe_mmaps(vdev); return 0; @@ -380,7 +384,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) /* Stop the device from further DMA */ pci_clear_master(pdev); - +#if 0 vfio_pci_set_irqs_ioctl(vdev, VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER, vdev->irq_type, 0, 0, NULL); @@ -393,17 +397,17 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) kfree(ioeventfd); } vdev->ioeventfds_nr = 0; - +#endif vdev->virq_disabled = false; - +#if 0 for (i = 0; i < vdev->num_regions; i++) vdev->region[i].ops->release(vdev, &vdev->region[i]); - +#endif vdev->num_regions = 0; kfree(vdev->region); vdev->region = NULL; /* don't krealloc a freed pointer */ - vfio_config_free(vdev); + //vfio_config_free(vdev); for (bar = PCI_STD_RESOURCES; bar <= PCI_STD_RESOURCE_END; bar++) { if (!vdev->barmap[bar]) @@ -420,7 +424,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) kfree(dummy_res); } - vdev->needs_reset = true; + //vdev->needs_reset = true; /* * If we have saved state, restore it. If we can reset the device, @@ -428,6 +432,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) * nothing, but saving and restoring current state without reset * is just busy work. */ +#if 0 if (pci_load_and_free_saved_state(pdev, &vdev->pci_saved_state)) { pr_info("%s: Couldn't reload %s saved state\n", __func__, dev_name(&pdev->dev)); @@ -452,6 +457,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) vdev->needs_reset = false; pci_restore_state(pdev); +#endif out: pci_disable_device(pdev); |