From: Heiner Kallweit <hkallweit1@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: [PATCH] PCI: make pci_set_mwi a dummy for PCIe devices
Date: Sun, 21 Oct 2018 17:06:58 +0200 [thread overview]
Message-ID: <0599e4ea-55ce-9aba-d5af-1625a3db0701@gmail.com> (raw)
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
next reply other threads:[~2018-10-21 15:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-21 15:06 Heiner Kallweit [this message]
2019-01-30 19:17 ` [PATCH] PCI: make pci_set_mwi a dummy for PCIe devices Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0599e4ea-55ce-9aba-d5af-1625a3db0701@gmail.com \
--to=hkallweit1@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.