diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-03-03 13:38:43 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-07-19 20:58:31 -0400 |
commit | a2be65fd363831502afdf0babdf48149b3959cde (patch) | |
tree | 07d69e95d8abb66eca6c13e59ee22dd1e6b6bb20 /drivers/xen/xen-pciback | |
parent | fd5b221b348adf63d413de9adad030e4f13664b7 (diff) |
xen/pciback: Disable MSI/MSI-X when reseting a device
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>
Diffstat (limited to 'drivers/xen/xen-pciback')
-rw-r--r-- | drivers/xen/xen-pciback/pciback_ops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c index 2b9a93e1fdee..011db675e437 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c | |||
@@ -23,6 +23,14 @@ void pciback_reset_device(struct pci_dev *dev) | |||
23 | 23 | ||
24 | /* Disable devices (but not bridges) */ | 24 | /* Disable devices (but not bridges) */ |
25 | if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) { | 25 | if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) { |
26 | #ifdef CONFIG_PCI_MSI | ||
27 | /* The guest could have been abruptly killed without | ||
28 | * disabling MSI/MSI-X interrupts.*/ | ||
29 | if (dev->msix_enabled) | ||
30 | pci_disable_msix(dev); | ||
31 | if (dev->msi_enabled) | ||
32 | pci_disable_msi(dev); | ||
33 | #endif | ||
26 | pci_disable_device(dev); | 34 | pci_disable_device(dev); |
27 | 35 | ||
28 | pci_write_config_word(dev, PCI_COMMAND, 0); | 36 | pci_write_config_word(dev, PCI_COMMAND, 0); |