From: Keith Busch <keith.busch@intel.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: Jon Derrick <jonathan.derrick@intel.com>,
Wei Zhang <wzhang@fb.com>, Keith Busch <keith.busch@intel.com>
Subject: [PATCHv2 4/4] pci/msix: Skip disabling removed devices
Date: Tue, 6 Sep 2016 16:00:19 -0600 [thread overview]
Message-ID: <1473199219-3369-5-git-send-email-keith.busch@intel.com> (raw)
In-Reply-To: <1473199219-3369-1-git-send-email-keith.busch@intel.com>
There is no need to disable MSIx interrupts or write message data on a
device that isn't present. This patch checks the device removed state
prior to executing device shutdown operations so that teardown on removed
devices is quicker.
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
drivers/pci/msi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a02981e..474d808 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -316,7 +316,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 || dev->is_removed) {
/* Don't touch the hardware now */
} else if (entry->msi_attrib.is_msix) {
void __iomem *base = pci_msix_desc_addr(entry);
@@ -999,6 +999,11 @@ void pci_msix_shutdown(struct pci_dev *dev)
if (!pci_msi_enable || !dev || !dev->msix_enabled)
return;
+ if (dev->is_removed) {
+ 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 */
--
2.7.2
next prev parent reply other threads:[~2016-09-06 22:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 22:00 [PATCHv2 0/4] Limiting pci access requsets Keith Busch
2016-09-06 22:00 ` [PATCHv2 1/4] pci: Add is_removed state Keith Busch
2016-09-07 11:14 ` Lukas Wunner
2016-09-17 8:35 ` Lukas Wunner
2016-09-19 17:47 ` Keith Busch
2016-09-06 22:00 ` [PATCHv2 2/4] pci: No config access for removed devices Keith Busch
2016-09-07 12:03 ` kbuild test robot
2016-09-07 16:28 ` Keith Busch
2016-09-06 22:00 ` [PATCHv2 3/4] pcie/aer: Cache capability position Keith Busch
2016-09-07 11:30 ` Lukas Wunner
2016-09-13 22:07 ` Bjorn Helgaas
2016-09-06 22:00 ` Keith Busch [this message]
2016-09-07 13:28 ` [PATCHv2 0/4] Limiting pci access requsets Lukas Wunner
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=1473199219-3369-5-git-send-email-keith.busch@intel.com \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=wzhang@fb.com \
/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.