From: Shawn Lin <shawn.lin@rock-chips.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: shawn.lin@rock-chips.com, "Jingoo Han" <jingoohan1@gmail.com>,
"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-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
vincent.guittot@linaro.org, zhangsenchuan@eswincomputing.com,
dlemoal@kernel.org, manivannan.sadhasivam@oss.qualcomm.com
Subject: Re: [PATCH v3 0/4] PCI: dwc: Rework the error handling of dw_pcie_wait_for_link() API
Date: Thu, 22 Jan 2026 11:37:23 +0800 [thread overview]
Message-ID: <ea1b977e-069d-4084-9bf4-d5bd8cd273d5@rock-chips.com> (raw)
In-Reply-To: <aXDTCQeP3CDv5qv8@ryzen>
在 2026/01/21 星期三 21:22, Niklas Cassel 写道:
> Hello Shawn,
>
> On Wed, Jan 21, 2026 at 08:45:39PM +0800, Shawn Lin wrote:
>> 在 2026/01/02 星期五 20:01, Niklas Cassel 写道:
>>
>> Hi Niklas,
>>
>> Sorry for chiming in on this so late. There is a register called
>> PCIE_CLIENT_GENERAL_DEBUG_CON you may find on RK3588 TRM, you could
>> hold LTSSM on EP side in DETECT_QUIET before enabling trainning, by
>> setting BIT(6). And when EP side is ready to go, just clear BIT(6),
>> so the link is able to be established and host side can rescan to
>> find the EP properly.
>
> Thank you for the suggestion.
>
> Reading the register description of this debug control register.
> For as log as sd_hold_ltssm is set, the controller stays in the
> current LTSSM.
>
> We could probably set this on the EP side, and only when starting
> the link do we clear this bit.
>
> However, I think that Mani's current proposal:
> https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc&id=01d16b8afb7afcc17f999f8b4a9b9cfe6c6fae71
>
>
> Will work with more controllers running in EP mode, not just rk3588.
>
> Also, when powering on both boards at the same time, it is possible that
> the host side driver gets probed before the EP side.
> If the EP side driver has not been probed to set bit sd_hold_ltssm,
> the host will still see a load connected, but link training will fail,
> so it will still jump to Poll.Compliance.
>
> So AFAICT, Mani's proposal:
> 1) Seems more generic.
> 2) Seems less racy.
>
Just a update for what I found when playing with the IP
on this topic :)
1. enable PCIE_CAP_ENTER_COMPLIANCE bit for
LINK_CONTROL2_LINK_STATUS2_REG (PCIE_CAP + 0xa0), which forces the RP
into poll.compliance to sumulate this situation, even without devices
connected to the slot.
2. set DIRECT_POLCOMP_TO_DETECT(bit 9) and HOLD_LTSSM(bit 0) to
SD_CONTROL2_REG, and could find it's still in poll.compliance.
3. clr HOLD_LTSSM only, and the LTSMM back to detect.quite and stay
there.
This seems be able to work with dwc with RAS_DES support.But sure,
Mani's approach looks more stright forward and works for all
controllers.
>
> Kind regards,
> Niklas
>
next prev parent reply other threads:[~2026-01-22 3:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 15:07 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
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 [this message]
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=ea1b977e-069d-4084-9bf4-d5bd8cd273d5@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--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=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
all inboxes | Powered by JetHome®