Skip to content

FROMGIT: power: sequencing: pwrseq-pcie-m2: Support PCIe switch topologies - #1079

Open
weiden (WeiDeng-weiden) wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
WeiDeng-weiden:qcom-6.18.y
Open

FROMGIT: power: sequencing: pwrseq-pcie-m2: Support PCIe switch topologies#1079
weiden (WeiDeng-weiden) wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
WeiDeng-weiden:qcom-6.18.y

Conversation

@WeiDeng-weiden

Copy link
Copy Markdown

The PCI parent OF node check in pwrseq_pcie_m2_notify() and pwrseq_pcie_m2_create_serdev() only looks at the immediate parent of the PCI endpoint device. This fails when a PCIe switch inserts one or more intermediate bridges between the root port and the endpoint.

For example, on lemans-evk with IFP Mezzanine board, the Toshiba TC9562 PCIe switch creates two bridge devices (upstream and downstream ports) without OF nodes, so the WCN6855 BT device appears at depth 3 and its immediate parent has of_node=NULL.

Add a helper pwrseq_pcie_m2_pci_parent_matches() that walks the PCI parent chain upward until it finds a device whose OF node matches the expected connector port node, or reaches a non-PCI device. Replace both single-level checks with this helper to handle arbitrary PCIe switch depths.

Reviewed-by: Manivannan Sadhasivam manivannan.sadhasivam@oss.qualcomm.com
Link: https://patch.msgid.link/20260907122129.1577279-1-wei.deng@oss.qualcomm.com

CRs-fixed: 4664967

…ogies

The PCI parent OF node check in pwrseq_pcie_m2_notify() and
pwrseq_pcie_m2_create_serdev() only looks at the immediate parent of the
PCI endpoint device. This fails when a PCIe switch inserts one or more
intermediate bridges between the root port and the endpoint.

For example, on lemans-evk with IFP Mezzanine board, the Toshiba TC9562
PCIe switch creates two bridge devices (upstream and downstream ports)
without OF nodes, so the WCN6855 BT device appears at depth 3 and its
immediate parent has of_node=NULL.

Add a helper pwrseq_pcie_m2_pci_parent_matches() that walks the PCI
parent chain upward until it finds a device whose OF node matches the
expected connector port node, or reaches a non-PCI device. Replace both
single-level checks with this helper to handle arbitrary PCIe switch
depths.

Signed-off-by: Wei Deng <wei.deng@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260907122129.1577279-1-wei.deng@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant