Re: [PATCH] power: sequencing: pwrseq-pcie-m2: Support PCIe switch topologies

From: Manivannan Sadhasivam

Date: Wed Sep 09 2026 - 07:37:57 EST


On Mon, Sep 07, 2026 at 05:51:29PM +0530, Wei Deng wrote:
> 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@xxxxxxxxxxxxxxxx>

I'd have fancied a device_for_each* helper, but that's not a big deal and
probably an overkill for just one user.

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani

--
மணிவண்ணன் சதாசிவம்