From: Shawn Lin <shawn.lin@rock-chips.com>
To: Igor Velkov <iav@iav.lv>
Cc: shawn.lin@rock-chips.com,
"Enrique Hernández Bello" <ehbello@gmail.com>,
lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org,
bhelgaas@google.com, robh@kernel.org, heiko@sntech.de,
linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 0/2] PCI: rockchip-host: Retry training and hot-reset a JMB585 on RK3399
Date: Sat, 7 Nov 2026 10:35:04 +0800 [thread overview]
Message-ID: <6c9adabe-d632-471e-8fc1-aafe62115167@rock-chips.com> (raw)
In-Reply-To: <20261106-rockchip-pcie-ltssm-trace-1@iav.lv>
在 2026/11/06 星期五 13:09, Igor Velkov 写道:
> Hi Shawn,
>
> I traced the LTSSM on the Helios64 (RK3399 + JMB585, x2, 2.5 GT/s) by
> polling PCIE_CLIENT_DEBUG_OUT_0 about every 2 us during link training
> and the waits after it. This changes what the RFC said, so here are the
> data and a question.
>
> A failing link bring-up looks like this:
>
> - the LTSSM reaches L0 as fast as in a good one;
> - then it leaves L0 for Recovery (RcvrLock/RcvrCfg/Idle, about 5 us)
> every 199..204 us, for as long as I watch: 488 times per 100 ms;
> - link_st in BASIC_STATUS1 becomes 3 only 15..47 ms after training
> starts, or not within 700 ms; the latter is the "link training gen1
> timeout" with LTSSM 0x10;
> - the RC shows nothing: AER and the device status are clear, and a dump
> of the client, core management and root port config registers is
> identical to a good bring-up.
>
> A good bring-up has no Recovery entry after L0. A config read on a bad
> link gets no completion; that is the abort I reported. 200 us is the
> optional Flow Control Update timeout, so I suspect that one side does
> not see the DLLPs of the other.
>
> The state survives Recovery but not Detect: a port re-init or a hot
> reset is just one more bring-up, with the same odds. So the hot reset
> of patch 2/2 does not cure anything, and the time the link takes to
> return is not a reliable sign either.
>
> Unbind/bind cycles with a bad bring-up (a cycle is one training plus
> one hot reset):
>
> Helios64, JMB585, x2 6 of 104
> same, PHY refclk 100 MHz from NPLL 4 of 33
> same, num-lanes = <1> 0 of 104
> ROCK Pi 4A, WD SN770 NVMe, x4 0 of 100
> same, num-lanes = <2> 0 of 100
>
> So it takes both lanes and the JMB585.
>
> Is anything like this known for the RK3399 with a two-lane endpoint,
> for example lane-to-lane skew of the transmitter, or a PHY setting that
I didn't know an issue like this. But yes, there is an option to disable
the automatic deskew adjusting algorithm by:
phy_wr_cfg(rk_phy, 0x6, BIT(1)); // dis auto deskew
phy_wr_cfg(rk_phy, 0x4, deskew trim value); // deskew value, 0x0 <-> 0xf
phy_wr_cfg(rk_phy, 0xb, deskew magnitude vale); //Default 00 is 2x, 01
is 1x, 11 is 3x and 10 turns it off
> affects it? And is there a bit in DEBUG_OUT_0/1 that tells which side
> directs the Recovery?
>
These debug section lies on Appendix section of PCIe chanpter, RK3399
TRM. You could try to find some clue by dumping DEBUG_DATA_OUT info.
Most kinds of these problems should be obvious to the PCIe analyzer
but might not be easy to check from the register IMO.
> Both boards ran the same build: v7.3.1 with the Armbian patches and the
> tracing. The Helios64 DT has no ep-gpios there, the ROCK Pi 4A DT has.
>
> Thanks,
> Igor
>
next prev parent reply other threads:[~2026-11-07 2:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 1:02 Igor Velkov via B4 Relay
2026-10-24 1:02 ` [PATCH RFC 1/2] PCI: rockchip-host: Retry link training that times out Igor Velkov via B4 Relay
2026-10-24 1:02 ` [PATCH RFC 2/2] PCI: rockchip-host: Hot-reset the endpoint before using the link Igor Velkov via B4 Relay
2026-10-26 9:08 ` [PATCH RFC 0/2] PCI: rockchip-host: Retry training and hot-reset a JMB585 on RK3399 Shawn Lin
2026-10-26 18:28 ` Igor Velkov
2026-10-27 0:44 ` Shawn Lin
2026-10-27 1:15 ` Igor Velkov
2026-10-28 17:31 ` Enrique Hernández Bello
2026-10-30 21:30 ` Igor Velkov
2026-11-06 5:09 ` Igor Velkov
2026-11-07 2:35 ` Shawn Lin [this message]
2026-11-08 23:05 ` Igor Velkov
2026-11-09 2:06 ` Shawn Lin
2026-11-09 4:54 ` Igor Velkov
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=6c9adabe-d632-471e-8fc1-aafe62115167@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=bhelgaas@google.com \
--cc=ehbello@gmail.com \
--cc=heiko@sntech.de \
--cc=iav@iav.lv \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--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®