linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 0/4] Limiting pci access requsets
Date: Tue,  6 Sep 2016 16:00:15 -0600	[thread overview]
Message-ID: <1473199219-3369-1-git-send-email-keith.busch@intel.com> (raw)

Here's version two of this, and is even more aggressive than before
about reducing access that we know will end in failure.

The first two patches are new. It attempts to completely remove config
space access on removed devices.

Patch 1/4 adds a new state to pci_dev called "is_removed" that's set
when the device is detected to be inaccessible.

Patch 2/4 returns immediately from any config space access request on
devices in such a state so we don't rely on hardware to handle this.

I dropped the patch to abort searching pcie extended capabilities. Caching
the AER capability obviates any immediate need for that.

Patch 3/4 moves the cached aer_cap from the aer driver's private structure
to the pci_dev structure so all devices in the sub-tree know about this
capability postition.

Patch 4/4 is still skipping disabling MSI-x when removed, and I added a
new check prior to writing any MSI messages as well. The criteria being
checked is the new "is_removed" state rather than verifying the VID/DID is
valid, which potentially just introduces additional config space access.

This series reduces the number of non-functional MMIO and config space
accesses on a hot removed device from ~1000 commands to ~1, improving
software's time to teardown surprise removed devices.

Keith Busch (4):
  pci: Add is_removed state
  pci: No config access for removed devices
  pcie/aer: Cache capability position
  pci/msix: Skip disabling removed devices

 drivers/pci/hotplug/pciehp_pci.c   |  2 ++
 drivers/pci/msi.c                  |  7 ++++++-
 drivers/pci/pci.c                  |  9 ++++++++-
 drivers/pci/pcie/aer/aerdrv.c      | 10 +++++-----
 drivers/pci/pcie/aer/aerdrv_core.c | 12 ++++++------
 drivers/pci/pcie/pcie-dpc.c        |  1 +
 drivers/pci/probe.c                |  2 ++
 include/linux/pci.h                | 20 ++++++++++++++++++++
 8 files changed, 50 insertions(+), 13 deletions(-)

-- 
2.7.2


             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 Keith Busch [this message]
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 ` [PATCHv2 4/4] pci/msix: Skip disabling removed devices Keith Busch
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-1-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 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).