Message ID | 1486144555-5526-5-git-send-email-keith.busch@intel.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
> @@ -317,7 +317,7 @@ void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) > { > struct pci_dev *dev = msi_desc_to_pci_dev(entry); > > - if (dev->current_state != PCI_D0) { > + if (dev->current_state != PCI_D0 || pci_dev_is_disconnected(dev)) { It also skips any MSI message writes as far as I cann tell from the above. Which seems sensible, but should be mentioned in the changelog. Otherwise looks fine to me: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 50c5003..17807eb3 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -317,7 +317,7 @@ void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) { struct pci_dev *dev = msi_desc_to_pci_dev(entry); - if (dev->current_state != PCI_D0) { + if (dev->current_state != PCI_D0 || pci_dev_is_disconnected(dev)) { /* Don't touch the hardware now */ } else if (entry->msi_attrib.is_msix) { void __iomem *base = pci_msix_desc_addr(entry); @@ -1020,6 +1020,11 @@ void pci_msix_shutdown(struct pci_dev *dev) if (!pci_msi_enable || !dev || !dev->msix_enabled) return; + if (pci_dev_is_disconnected(dev)) { + dev->msix_enabled = 0; + return; + } + /* Return the device with MSI-X masked as initial states */ for_each_pci_msi_entry(entry, dev) { /* Keep cached states to be restored */
This patch checks the device connected state prior to executing device shutdown operations so that tear down on disconnected devices completes quicker. Signed-off-by: Keith Busch <keith.busch@intel.com> --- drivers/pci/msi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)