Skip to content

Commit

Permalink
xen/pciback: Disable MSI/MSI-X when reseting a device
Browse files Browse the repository at this point in the history
In cases where the guest is abruptly killed and has not disabled
MSI/MSI-X interrupts we want to do it for it.

Otherwise when the guest is started up and enables MSI, we would
get a WARN() that the device already had been enabled.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Jul 20, 2011
1 parent fd5b221 commit a2be65f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/xen/xen-pciback/pciback_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ void pciback_reset_device(struct pci_dev *dev)

/* Disable devices (but not bridges) */
if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
#ifdef CONFIG_PCI_MSI
/* The guest could have been abruptly killed without
* disabling MSI/MSI-X interrupts.*/
if (dev->msix_enabled)
pci_disable_msix(dev);
if (dev->msi_enabled)
pci_disable_msi(dev);
#endif
pci_disable_device(dev);

pci_write_config_word(dev, PCI_COMMAND, 0);
Expand Down

0 comments on commit a2be65f

Please sign in to comment.