The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Qiang Yu" <qiang.yu@oss.qualcomm.com>,
	linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: qcom: avoid duplicate PERST# GPIO acquisition in legacy path
Date: Tue, 26 May 2026 09:54:52 -0500	[thread overview]
Message-ID: <ahW0HOEMnJIHviLi@baldur> (raw)
In-Reply-To: <20260526-fix_perst_gpio_handling-v1-1-9170507bb4e9@oss.qualcomm.com>

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@oss.qualcomm.com>
> ---
>  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@oss.qualcomm.com>
> 
> 

      parent reply	other threads:[~2026-05-26 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 11:32 [PATCH] PCI: qcom: avoid duplicate PERST# GPIO acquisition in legacy path Kathiravan Thirumoorthy
2026-05-26 14:46 ` Manivannan Sadhasivam
2026-05-26 14:54 ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ahW0HOEMnJIHviLi@baldur \
    --to=andersson@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kathiravan.thirumoorthy@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=qiang.yu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox