diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2016-09-26 15:52:19 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-09-26 15:52:19 -0400 |
commit | c93a97ee0583cd65adaf872e7cc402493eae92a7 (patch) | |
tree | b36343f50b4951020fc9b7e099f2b7db640eb3e8 | |
parent | ddf9dc0eb5314d6dac8b19b1cc37c739c6896e7e (diff) |
vfio-pci: Disable INTx after MSI/X teardown
The MSI/X shutdown path can gratuitously enable INTx, which is not
something we want to happen if we're dealing with broken INTx device.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r-- | drivers/vfio/pci/vfio_pci_intrs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index 152b43822ef1..aa23e9a4a22f 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c +++ b/drivers/vfio/pci/vfio_pci_intrs.c | |||
@@ -414,6 +414,13 @@ static void vfio_msi_disable(struct vfio_pci_device *vdev, bool msix) | |||
414 | } else | 414 | } else |
415 | pci_disable_msi(pdev); | 415 | pci_disable_msi(pdev); |
416 | 416 | ||
417 | /* | ||
418 | * Both disable paths above use pci_intx_for_msi() to clear DisINTx | ||
419 | * via their shutdown paths. Restore for NoINTx devices. | ||
420 | */ | ||
421 | if (vdev->nointx) | ||
422 | pci_intx(pdev, 0); | ||
423 | |||
417 | vdev->irq_type = VFIO_PCI_NUM_IRQS; | 424 | vdev->irq_type = VFIO_PCI_NUM_IRQS; |
418 | vdev->num_ctx = 0; | 425 | vdev->num_ctx = 0; |
419 | kfree(vdev->ctx); | 426 | kfree(vdev->ctx); |