Skip to content

RFC PCI: introduce the concept of power sequencing of PCIe devices

Bartosz Golaszewski linux-arm-kernel linux-arm-msm linux-devicetree linux-pci linux-renesas-soc linux-wireless lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 patches 48 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9arm64: dts: qcom: sm8250: describe the PCIe portarch/arm64/boot/dts/qcom/sm8250.dtsi+10 -00 replies
2/9arm64: dts: qcom: qrb5165-rb5: describe the WLAN module of QCA6390arch/arm64/boot/dts/qcom/qrb5165-rb5.dts+24 -02 replies
3/9PCI/portdrv: create platform devices for child OF nodesdrivers/pci/pcie/portdrv.c+2 -119 replies
4/9PCI: hold the rescan mutex when scanning for the first timedrivers/pci/probe.c+2 -00 replies
5/9PCI/pwrseq: add pwrseq core codedrivers/pci/pcie/Kconfig drivers/pci/pcie/Makefile drivers/pci/pcie/pwrseq/Kconfig +3 more+122 -01 reply
6/9dt-bindings: vendor-prefixes: add a PCI prefix for Qualcomm AtherosDocumentation/devicetree/bindings/vendor-prefixes.yaml+1 -07 replies
7/9dt-bindings: wireless: ath11k: describe QCA6390Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml+14 -02 replies
8/9PCI/pwrseq: add a pwrseq driver for QCA6390drivers/pci/pcie/pwrseq/Kconfig drivers/pci/pcie/pwrseq/Makefile drivers/pci/pcie/pwrseq/pcie-pwrseq-qca6390.c+209 -09 replies
9/9arm64: defconfig: enable the PCIe power sequencing for QCA6390arch/arm64/configs/defconfig+2 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/9] PCI: introduce the concept of power sequencing of PCIe devices

From: Bartosz Golaszewski <[email protected]>

During last year's Linux Plumbers we had several discussions centered around the need to power-on PCI devices before they can be detected on the bus.

The consensus during the conference was that we need to introduce a class of "PCI slot drivers" that would handle the power-sequencing.

After some additional brain-storming with Manivannan and the realization that the DT maintainers won't like adding any "fake" nodes not representing actual devices, we decided to reuse the existing infrastructure provided by the PCIe port drivers.

The general idea is to instantiate platform devices for child nodes of the PCIe port DT node. For those nodes for which a power-sequencing driver exists, we bind it and let it probe. The driver then triggers a rescan of the PCI bus with the aim of detecting the now powered-on device. The device will consume the same DT node as the platform, power-sequencing device. We use device links to make the latter become the parent of the former.

The main advantage of this approach is not modifying the existing DT in any way and especially not adding any "fake" platform devices.

Bartosz Golaszewski (9):
arm64: dts: qcom: sm8250: describe the PCIe port
arm64: dts: qcom: qrb5165-rb5: describe the WLAN module of QCA6390 PCI/portdrv: create platform devices for child OF nodes
PCI: hold the rescan mutex when scanning for the first time PCI/pwrseq: add pwrseq core code
dt-bindings: vendor-prefixes: add a PCI prefix for Qualcomm Atheros
dt-bindings: wireless: ath11k: describe QCA6390 PCI/pwrseq: add a pwrseq driver for QCA6390
arm64: defconfig: enable the PCIe power sequencing for QCA6390

 .../net/wireless/qcom,ath11k-pci.yaml         |  14 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |   1 +
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts      |  24 +++
 arch/arm64/boot/dts/qcom/sm8250.dtsi          |  10 +
 arch/arm64/configs/defconfig                  |   2 +
 drivers/pci/pcie/Kconfig                      |   2 +
 drivers/pci/pcie/Makefile                     |   2 +
 drivers/pci/pcie/portdrv.c                    |   3 +-
 drivers/pci/pcie/pwrseq/Kconfig               |  19 ++
 drivers/pci/pcie/pwrseq/Makefile              |   4 +
 drivers/pci/pcie/pwrseq/pcie-pwrseq-qca6390.c | 197 ++++++++++++++++++
 drivers/pci/pcie/pwrseq/pwrseq.c              |  83 ++++++++
 drivers/pci/probe.c                           |   2 +
 include/linux/pcie-pwrseq.h                   |  24 +++
 14 files changed, 386 insertions(+), 1 deletion(-)
 create mode 100644 drivers/pci/pcie/pwrseq/Kconfig
 create mode 100644 drivers/pci/pcie/pwrseq/Makefile
 create mode 100644 drivers/pci/pcie/pwrseq/pcie-pwrseq-qca6390.c
 create mode 100644 drivers/pci/pcie/pwrseq/pwrseq.c
 create mode 100644 include/linux/pcie-pwrseq.h
Signature · 1 line
2.40.1