diff mbox series

PCI: Don't bother PCIe devices with trying to set MWI

Message ID 86740fb7-5257-881c-e83a-7753f3b4badd@gmail.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Don't bother PCIe devices with trying to set MWI | expand

Commit Message

Heiner Kallweit Dec. 8, 2020, 12:16 p.m. UTC
Don't bother PCIe devices with trying to set MWI.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/pci/pci.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 9c49b96c2..b7f0883d6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4347,6 +4347,9 @@  int pci_set_mwi(struct pci_dev *dev)
 	int rc;
 	u16 cmd;
 
+	if (pci_is_pcie(dev))
+		return 0;
+
 	rc = pci_set_cacheline_size(dev);
 	if (rc)
 		return rc;
@@ -4374,6 +4377,9 @@  int pcim_set_mwi(struct pci_dev *dev)
 {
 	struct pci_devres *dr;
 
+	if (pci_is_pcie(dev))
+		return 0;
+
 	dr = find_pci_dr(dev);
 	if (!dr)
 		return -ENOMEM;
@@ -4413,6 +4419,9 @@  void pci_clear_mwi(struct pci_dev *dev)
 #ifndef PCI_DISABLE_MWI
 	u16 cmd;
 
+	if (pci_is_pcie(dev))
+		return;
+
 	pci_read_config_word(dev, PCI_COMMAND, &cmd);
 	if (cmd & PCI_COMMAND_INVALIDATE) {
 		cmd &= ~PCI_COMMAND_INVALIDATE;