From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: manivannan.sadhasivam@oss.qualcomm.com,
"Jingoo Han" <jingoohan1@gmail.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
vincent.guittot@linaro.org, zhangsenchuan@eswincomputing.com,
"Shawn Lin" <shawn.lin@rock-chips.com>,
dlemoal@kernel.org
Subject: Re: [PATCH v3 0/4] PCI: dwc: Rework the error handling of dw_pcie_wait_for_link() API
Date: Tue, 20 Jan 2026 15:35:16 +0100 [thread overview]
Message-ID: <aW-SpCEPSakHAJ0B@ryzen> (raw)
In-Reply-To: <ouygfgehh3evllgcibintuer6euyqrrn3otg3ets3frcd7i5wt@nnyjibcrw6ds>
On Fri, Jan 16, 2026 at 02:27:39PM +0530, Manivannan Sadhasivam wrote:
(snip)
> > So I don't think that setting the DIRECT_POLCOMP_TO_DETECT bit will
> > help us PCIe endpoint developers to continue with the workflow where we
> > can simply do a rescan on the host after starting the link training on
> > the EP.
> >
> > Back to finding another alternative. Kconfig? module param? Suggestions?
> >
>
> I don't like the user to control this behavior as it is just how the link
> behaves. Maybe we can allow the link to stay in POLL and print out a different
> message, and still return -ENODEV? Like,
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> index c2dfadc53d04..21ce206f359b 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.c
> +++ b/drivers/pci/controller/dwc/pcie-designware.c
> @@ -774,6 +774,14 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
> ltssm == DW_PCIE_LTSSM_DETECT_ACT) {
> dev_info(pci->dev, "Device not found\n");
> return -ENODEV;
> + /*
> + * If the link is in POLL.Compliance state, then the device is
> + * found to be connected to the bus, but it is not active i.e.,
> + * the device firmware might not yet initialized.
> + */
> + } else if (ltssm == DW_PCIE_LTSSM_POLL_COMPLIANCE) {
> + dev_info(pci->dev, "Device found, but not active\n");
> + return -ENODEV;
> }
>
> dev_err(pci->dev, "Link failed to come up. LTSSM: %s\n",
Seems like an excellent idea to me!
I tested it, and it works, thank you.
Kind regards,
Niklas
next prev parent reply other threads:[~2026-01-20 14:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 15:07 [PATCH v3 0/4] PCI: dwc: Rework the error handling of dw_pcie_wait_for_link() API Manivannan Sadhasivam via B4 Relay
2025-12-30 15:07 ` [PATCH v3 1/4] PCI: dwc: Return -ENODEV from dw_pcie_wait_for_link() if device is not found Manivannan Sadhasivam via B4 Relay
2025-12-30 15:07 ` [PATCH v3 2/4] PCI: dwc: Rename and move ltssm_status_string() to pcie-designware.c Manivannan Sadhasivam via B4 Relay
2025-12-30 15:07 ` [PATCH v3 3/4] PCI: dwc: Rework the error print of dw_pcie_wait_for_link() Manivannan Sadhasivam via B4 Relay
2025-12-30 15:07 ` [PATCH v3 4/4] PCI: dwc: Only skip the dw_pcie_wait_for_link() failure if it returns -ENODEV Manivannan Sadhasivam via B4 Relay
2026-01-02 12:01 ` [PATCH v3 0/4] PCI: dwc: Rework the error handling of dw_pcie_wait_for_link() API Niklas Cassel
2026-01-05 11:41 ` Manivannan Sadhasivam
2026-01-07 12:52 ` Niklas Cassel
2026-01-09 16:21 ` Niklas Cassel
2026-01-16 8:57 ` Manivannan Sadhasivam
2026-01-20 14:35 ` Niklas Cassel [this message]
2026-01-21 12:45 ` Shawn Lin
2026-01-21 13:22 ` Niklas Cassel
2026-01-21 15:47 ` Manivannan Sadhasivam
2026-01-22 3:37 ` Shawn Lin
2026-01-05 10:04 ` Vincent Guittot
2026-01-05 11:52 ` Manivannan Sadhasivam
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=aW-SpCEPSakHAJ0B@ryzen \
--to=cassel@kernel.org \
--cc=bhelgaas@google.com \
--cc=dlemoal@kernel.org \
--cc=jingoohan1@gmail.com \
--cc=kwilczynski@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=robh@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=vincent.guittot@linaro.org \
--cc=zhangsenchuan@eswincomputing.com \
/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