Re: [PATCH] PCI: qcom: avoid duplicate PERST# GPIO acquisition in legacy path

From: Bjorn Andersson

Date: Tue May 26 2026 - 11:10:40 EST


On Tue, May 26, 2026 at 05:02:30PM +0530, Kathiravan Thirumoorthy wrote:
> Commit deed8aec62dc ("PCI: qcom: Handle mixed PERST#/PHY DT
> configuration") handles the case where the PHY is moved to the Root
> Port node while PERST# remains in the RC node by acquiring the PERST#
> GPIO during Root Port parsing.
>
> However, on platforms such as IPQ5424, both PERST# and PHY are
> described under the RC node and are intended to be handled via the
> legacy binding path.

Please send patches to update IPQ5424 to the non-legacy binding.

Thanks,
Bjorn

> Since PERST# is already acquired during Root Port
> parsing, attempting to acquire it again in the legacy path fails,
> resulting in probe failures as shown below:
>
> [ 1.571859] qcom-pcie 18000000.pcie: probe with driver qcom-pcie failed with error -16
> [ 1.571909] qcom-pcie 10000000.pcie: probe with driver qcom-pcie failed with error -16
> [ 1.571973] qcom-pcie 20000000.pcie: probe with driver qcom-pcie failed with error -16
>
> Fix this by removing the redundant GPIO acquisition from
> qcom_pcie_parse_legacy_binding() and reusing the PERST# descriptor
> obtained in qcom_pcie_parse_ports().
>
> While at it, move the warning message to qcom_pcie_parse_perst() to
> avoid polluting dmesg when the legacy binding is used.
>
> Fixes: deed8aec62dc ("PCI: qcom: Handle mixed PERST#/PHY DT configuration")
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@xxxxxxxxxxxxxxxx>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 11fc60489892..77cbd204ac5c 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1824,6 +1824,7 @@ static int qcom_pcie_parse_perst(struct qcom_pcie *pcie,
> int ret;
>
> if (pcie->reset) {
> + dev_warn(dev, "Reusing PERST# from Root Complex node. DT needs to be fixed!\n");
> reset = pcie->reset;
> goto skip_perst_parsing;
> }
> @@ -1912,8 +1913,6 @@ static int qcom_pcie_parse_ports(struct qcom_pcie *pcie)
> GPIOD_OUT_HIGH);
> if (IS_ERR(pcie->reset))
> return PTR_ERR(pcie->reset);
> -
> - dev_warn(dev, "Reusing PERST# from Root Complex node. DT needs to be fixed!\n");
> }
>
> for_each_available_child_of_node_scoped(dev->of_node, of_port) {
> @@ -1942,7 +1941,6 @@ static int qcom_pcie_parse_legacy_binding(struct qcom_pcie *pcie)
> struct device *dev = pcie->pci->dev;
> struct qcom_pcie_perst *perst;
> struct qcom_pcie_port *port;
> - struct gpio_desc *reset;
> struct phy *phy;
> int ret;
>
> @@ -1950,10 +1948,6 @@ static int qcom_pcie_parse_legacy_binding(struct qcom_pcie *pcie)
> if (IS_ERR(phy))
> return PTR_ERR(phy);
>
> - reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_HIGH);
> - if (IS_ERR(reset))
> - return PTR_ERR(reset);
> -
> ret = phy_init(phy);
> if (ret)
> return ret;
> @@ -1970,7 +1964,7 @@ static int qcom_pcie_parse_legacy_binding(struct qcom_pcie *pcie)
> INIT_LIST_HEAD(&port->list);
> list_add_tail(&port->list, &pcie->ports);
>
> - perst->desc = reset;
> + perst->desc = pcie->reset;
> INIT_LIST_HEAD(&port->perst);
> INIT_LIST_HEAD(&perst->list);
> list_add_tail(&perst->list, &port->perst);
>
> ---
> base-commit: d387b06f7c15b4639244ad66b4b0900c6a02b430
> change-id: 20260525-fix_perst_gpio_handling-5a4fee9228fd
>
> Best regards,
> --
> Kathiravan Thirumoorthy <kathiravan.thirumoorthy@xxxxxxxxxxxxxxxx>
>
>