…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>
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