mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Qiang Yu <qiang.yu@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>,
	linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>
Subject: Re: [PATCH] PCI: qcom: Handle mixed PERST#/PHY DT configuration
Date: Tue, 2 Jun 2026 10:04:22 +0530	[thread overview]
Message-ID: <0bd70e70-68fe-436b-8366-8a497861e21d@oss.qualcomm.com> (raw)
In-Reply-To: <gieaybsg2ckxpctvqj77nlwu7utama2yeyvebkonmexsxrra3v@v3fobqasxnmy>


On 5/31/2026 4:37 PM, Dmitry Baryshkov wrote:
> On Fri, May 08, 2026 at 02:54:19AM -0700, Qiang Yu wrote:
>> The driver currently supports two PERST# and PHY DT configuration. In one
>> case, PHY, PERST#, are described in the RC node. In the other case, they
>> are described in the RP node.
>>
>> A mixed setup is not supported. One common example is PHY on the RP node
>> while PERST# remains on the RC node. In that case the driver goes through
>> the RP parse path, does not find PERST# on RP, and does not report an
>> error because PERST# is optional. Probe can then succeed silently while
>> PERST# is left uncontrolled, and PCIe endpoints fails to work later. This
>> silent probe success makes debugging difficult.
>>
>> Handle this mixed case in the RP parse path by checking whether PERST# is
>> present on RC and, if so, using the RC PERST# GPIO for RP ports while
>> keeping RP parsing for PHY. Emit a warning to indicate mixed DT content so
>> it can be fixed.
>>
>> This keeps mixed systems functional and makes the configuration issue
>> visible instead of failing later at endpoint bring-up.
>>
>> Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
>> Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> @@ -1778,6 +1785,14 @@ static int qcom_pcie_parse_ports(struct qcom_pcie *pcie)
>>   	struct device *dev = pcie->pci->dev;
>>   	int ret = -ENODEV;
>>   
>> +	if (of_find_property(dev->of_node, "perst-gpios", NULL)) {
>> +		pcie->reset = devm_gpiod_get_optional(dev, "perst", 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");
> This patch breaks legacy DTs (I stumbled on it on SM8350 HDK), because
> now devm_gpiod_get_optional() in qcom_pcie_parse_legacy_binding()
> returns -EBUSY (as the GPIO is already requested here). I'll send a
> patch fixing the issue, but it's sad to see existing platforms being
> broken for the sake of undeclared "mixed" case.

Dmitry,

I have sent[1] fix for this issue and it is squashed with the offending 
commit itself[2] and part of controller/dwc-qcom in the PCI tree.

[1] 
https://lore.kernel.org/linux-arm-msm/20260526-fix_perst_gpio_handling-v1-1-9170507bb4e9@oss.qualcomm.com/T/#u

[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc-qcom&id=1a23bcb452d95f099e530414504c0d99ee076b3f


  reply	other threads:[~2026-06-02  4:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08  9:54 Qiang Yu
2026-05-11 10:29 ` Konrad Dybcio
2026-05-15 16:52 ` Manivannan Sadhasivam
2026-05-31 11:07 ` Dmitry Baryshkov
2026-06-02  4:34   ` Kathiravan Thirumoorthy [this message]
2026-06-08  7:43     ` Dmitry Baryshkov

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=0bd70e70-68fe-436b-8366-8a497861e21d@oss.qualcomm.com \
    --to=kathiravan.thirumoorthy@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=dmitry.baryshkov@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=manivannan.sadhasivam@oss.qualcomm.com \
    --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

all inboxes | Powered by JetHome®