[PATCH v2 0/2] PCI: Add missing link delays

From: Mika Westerberg
Date: Fri Oct 04 2019 - 08:39:54 EST


Hi,

This is second version of the reworked PCIe link delay patch posted earlier
here:

https://patchwork.kernel.org/patch/11106611/

Changes from v1:

* Introduce pcie_wait_for_link_delay() in a separate patch
* Tidy up changelog, remove some debug output
* Rename pcie_wait_downstream_accessible() to
pci_bridge_wait_for_secondary_bus() and make it generic to all PCI
bridges.
* Handle Tpvrh + Trhfa for conventional PCI even though we don't do PM
for them right now.
* Use pci_dbg() instead of dev_dbg().
* Dropped check for pm_suspend_no_platform() and only check for D3cold.
* Drop pcie_get_downstream_delay(), same delay applies equally to all
devices (it is not entirely clear from the spec).

I'm still checking for downstream device because I think we can skip the
delays if there is nothing connected. The reason is that if device is added
when the downstream/root port is in D3 the delay is handled by pciehp in
its board_added(). In case of ACPI hotplug the firmware is supposed to
configure the device (and handle the delay).

I also checked we do resume sibling devices in paraller (I think due to
async_suspend).

@Matthias, @Paul and @Nicholas, I appreciate if you could check that this
does not cause any issues for your systems.

Mika Westerberg (2):
PCI: Introduce pcie_wait_for_link_delay()
PCI: Add missing link delays required by the PCIe spec

drivers/pci/pci-driver.c | 18 +++++++
drivers/pci/pci.c | 113 +++++++++++++++++++++++++++++++++++----
drivers/pci/pci.h | 1 +
3 files changed, 122 insertions(+), 10 deletions(-)

--
2.23.0