Re: [PATCH v5 2/2] PCI: rockchip-host: Make the PERST# inactive delay configurable

From: Shawn Lin

Date: Mon Nov 30 2026 - 03:40:59 EST


在 2026/11/30 星期一 15:57, Manivannan Sadhasivam 写道:
On Sun, Nov 29, 2026 at 08:20:36PM +0200, Igor Velkov wrote:
On 2026-11-29 19:35 +0530, Manivannan Sadhasivam wrote:
Basically, I just moved the LTSSM start after PERST# deassert and increased the
status check to 1s as per the spec.

The diff does not move the start of training: rockchip_pcie_init_port()
already sets PCIE_CLIENT_LINK_TRAIN_ENABLE for the RC, in the
PCIE_CLIENT_CONFIG write before the core resets are released. The moved
write only sets the bit again, so the 1 s timeout is the only change.

Ah, I didn't look into the implementation of rockchip_pcie_init_port(). But it
feels super weird to start the LTSSM in two successive places without a comment
in the code.


Looking back through the git history, this appears to be a leftover from
the rework that added EP support. In practice, rockchip_pcie_init_port()
should not enable LTSSM, that call can simply be removed. The LTSSM
enable in rockchip_pcie_host_init_port() could then be moved to after
#PERST is deasserted.

To start training after PERST#, init_port() would have to clear the bit
for the RC (PCIE_CLIENT_LINK_TRAIN_DISABLE).

Enrique, a test on the ROCK Pi 4C that needs no register change:
move msleep(PCIE_T_PVPERL_MS) to before rockchip_pcie_init_port().
The pulse stays ~100 ms, but training starts only just before PERST#
is released.


That reduces the delay window, which can help. But ideally, LTSSM should be
started after PERST# deassert. But doing so would require some code reorg and
need to ensure that the sequence mentioned in the hardware manual is not
disturbed.

Perhaps, Rockchip folks should make such a change?

Shawn, comments?

- Mani