]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: qcom: Parse PERST# from all PCIe bridge nodes
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Tue, 16 Dec 2025 12:51:43 +0000 (18:21 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 30 Dec 2025 17:12:50 +0000 (11:12 -0600)
commit2fd60a2edb83a6308fffd5ea2a76c221b61a4eb3
tree0dee5a2d0218d7d323adeb73459524df8a8588ae
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
PCI: qcom: Parse PERST# from all PCIe bridge nodes

Devicetree schema allows the PERST# GPIO to be present in all PCIe bridge
nodes, not just in Root Port node. But the current logic parses PERST# only
from the Root Port nodes. Though it is not causing any issue on the current
platforms, the upcoming platforms will have PERST# in PCIe switch
downstream ports also. So this requires parsing all the PCIe bridge nodes
for the PERST# GPIO.

Hence, rework the parsing logic to extend to all PCIe bridge nodes starting
from the Root Port node. If the 'reset-gpios' property is found for a PCI
bridge node, the GPIO descriptor will be stored in qcom_pcie_perst::desc
and added to the qcom_pcie_port::perst list.

It should be noted that if more than one bridge node has the same GPIO for
PERST# (shared PERST#), the driver will error out. This is due to the
limitation in the GPIOLIB subsystem that allows only exclusive (non-shared)
access to GPIOs from consumers. But this is soon going to get fixed. Once
that happens, it will get incorporated in this driver.

So for now, PERST# sharing is not supported.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com
drivers/pci/controller/dwc/pcie-qcom.c