diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2015-06-08 17:10:50 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-06-09 10:46:29 -0500 |
commit | a5dd4b4b0570b3bf880d563969b245dfbd170c1e (patch) | |
tree | 72e841a8152a57cf125853bd661cf3bae156e763 /drivers/pci/pci.h | |
parent | 0824965140fff1bf640a987dc790d1594a8e0699 (diff) | |
download | blackbird-obmc-linux-a5dd4b4b0570b3bf880d563969b245dfbd170c1e.tar.gz blackbird-obmc-linux-a5dd4b4b0570b3bf880d563969b245dfbd170c1e.zip |
PCI: pciehp: Wait for hotplug command completion where necessary
The commit referenced below deferred waiting for command completion until
the start of the next command, allowing hardware to do the latching
asynchronously. Unfortunately, being ready to accept a new command is the
only indication we have that the previous command is completed. In cases
where we need that state change to be enabled, we must still wait for
completion. For instance, pciehp_reset_slot() attempts to disable anything
that might generate a surprise hotplug on slots that support presence
detection. If we don't wait for those settings to latch before the
secondary bus reset, we negate any value in attempting to prevent the
spurious hotplug.
Create a base function with optional wait and helper functions so that
pcie_write_cmd() turns back into the "safe" interface which waits before
and after issuing a command and add pcie_write_cmd_nowait(), which
eliminates the trailing wait for asynchronous completion. The following
functions are returned to their previous behavior:
pciehp_power_on_slot
pciehp_power_off_slot
pcie_disable_notification
pciehp_reset_slot
The rationale is that pciehp_power_on_slot() enables the link and therefore
relies on completion of power-on. pciehp_power_off_slot() and
pcie_disable_notification() need a wait because data structures may be
freed after these calls and continued signaling from the device would be
unexpected. And, of course, pciehp_reset_slot() needs to wait for the
scenario outlined above.
Fixes: 3461a068661c ("PCI: pciehp: Wait for hotplug command completion lazily")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.17+
Diffstat (limited to 'drivers/pci/pci.h')
0 files changed, 0 insertions, 0 deletions