linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: make pci_set_mwi a dummy for PCIe devices
@ 2018-10-21 15:06 Heiner Kallweit
  2019-01-30 19:17 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2018-10-21 15:06 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci@vger.kernel.org

Memory-Write-Invalidate isn't applicable for PCIe devices, therefore
make the MWI functions a dummy and don't even write to the (dummy)
PCI config space registers.

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

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d068f11d0..fb63b3d89 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4137,6 +4137,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;
@@ -4203,6 +4206,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;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-30 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-21 15:06 [PATCH] PCI: make pci_set_mwi a dummy for PCIe devices Heiner Kallweit
2019-01-30 19:17 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).