Skip to content

PCI: pciehp: Do not turn off slot if presence comes up after link

Alexandru Gagniuc linux-pci lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 1 replyIn review
  2. v2 RFC4 patches 14 repliesSuperseded
  3. v11 patch 10 repliesSuperseded

Changes in v3 from the cover letter

* Dropped [RFC] from title
* Addressed style issue found by Lukas

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4PCI: hotplug: Add support for disabling in-band presencedrivers/pci/hotplug/pciehp.h drivers/pci/hotplug/pciehp_hpc.c include/uapi/linux/pci_regs.h+11 -10 replies
2/4PCI: pciehp: Do not turn off slot if presence comes up after linkdrivers/pci/hotplug/pciehp_ctrl.c+24 -00 replies
3/4PCI: hotplug: Wait for PDS when in-band presence is disableddrivers/pci/hotplug/pciehp_hpc.c+22 -00 replies
4/4PCI: hotplug: Add quirk For Dell nvme pcie switchesdrivers/pci/hotplug/pciehp_hpc.c include/linux/pci.h+22 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] PCI: pciehp: Do not turn off slot if presence comes up after link

According to the old PCIe spec, PDS would always have to come up with or before DLLLA. For various reasons, not all OEMs followed this requirement. As a result, in PCIe 4.0(*), there is a new way to disable in-band presence reporting, such that PDS always reports the status of the out-of-band presence (if implemented).

For us, this means it is legal to get a Card Present event after the link is active, and the driver was loaded. This causes an erroneous removal of the device driver, followed by immediate re-probing.

In a fully PCIe-compliant world, we could leave inband presence enabled and not require any software changes. However, certain OEMs simply disable inband presence without implementing the requisite query and control bits. I present two solutions to resolve this.

The first and last patch in the series are required. Of the remaining two, only one is required to complete the series. Since we don't yet have a go/no-go on which method to use, both solutions are included:
- 2/4: Try to wait for PDS _before_ loading the driver
- 3/4: Load as usual, and recognize the delayed PDS event as such

(*) ECN was approved in Nov 2018, and is normative spec text. A lot of the leaked PCIe 4.0 specs do not have this change.

Changes since v2:
* Dropped [RFC] from title
* Addressed style issue found by Lukas

Alexandru Gagniuc (4):
PCI: hotplug: Add support for disabling in-band presence
PCI: pciehp: Do not turn off slot if presence comes up after link
PCI: hotplug: Wait for PDS when in-band presence is disabled
PCI: hotplug: Add quirk For Dell nvme pcie switches

 drivers/pci/hotplug/pciehp.h      |  1 +
 drivers/pci/hotplug/pciehp_ctrl.c | 24 ++++++++++++++
 drivers/pci/hotplug/pciehp_hpc.c  | 52 ++++++++++++++++++++++++++++++-
 include/linux/pci.h               |  1 +
 include/uapi/linux/pci_regs.h     |  2 ++
 5 files changed, 79 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1