From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=210.79.60.123 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796028049; b=hamC6AFL2yZGgXBkh/Dm6iTBCmEV3Bn5Yckiif2Qrumjs0B4p5LBT0rr7wWBnydwC21B IJepBgTe7k6ON82jb1uVBvfmT3VOhR4iR17O9yVpTYOVlum5k0MGcGoMmXR8LT3x46sIf oX+Y95yJfVb/O1/9ngVWr+lfBwfKO3PNamDU9LiPL8330Kre7cql3VH8/iGc3HrcL2QlI gFANakGoy2XHTYZ99rGEEPlo4Ic/l4gWPljSCshts6vAbe4bqN2LI/SR2Bl1ozVdiO9oY hZlAdpO+/6hKTYd68bRWN7lvOYuVnk+Tcf0Ku6Zq2zamJSUoJBOXytP1vR0kOef8ELQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796028049; h=DMARC-Filter:Received:Message-ID:Date:MIME-Version:User-Agent:Cc: Subject:To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-HM-Tid:X-HM-MType:X-HM-Spam-Status: DKIM-Signature; bh=RFgcZYh9+xSxFVbvcjNtpbZMe4mhIjp4IFjC6haEipg=; b=m7kTrZc9LehseKmNpvS0BgIsmi/6Hrhiyw0F4WbZzR0jAUZCjjiNEB+PcG9sMJsmFiwE qv9gfvyzTncVf3ejkWsMKW8ONUuCd15hlQZIKjY5HvAzCIqu6VqFfWYa5QqMkG0jngyh5 UpXXEf8y5zpmG1qPJgC52aSTJc4DPOqjswPOR6aUvV4sRHMSNoNTmlJ4/XgxY4vLTKui0 W7zMVr9qRi5oOSHq31wGsHvfXMj+eC7vhmJ1eA/AM1bySKYk9UsMGSDBtQK7Ornr/V46i 40K+HEiAGqA2gVKkZDLGxEmwLSeremh0zqXVxTQlfCwLScg5ptRAp3PnGbVvgT50v2g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=rock-chips.com; spf=pass smtp.mailfrom=rock-chips.com; dkim=pass header.d=rock-chips.com header.i=@rock-chips.com header.a=rsa-sha256 header.s=default header.b=fHenqE8u; arc=none smtp.remote-ip=210.79.60.123 Received: from mail-m60123.netease.com (mail-m60123.netease.com [210.79.60.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DC18606A32A; Mon, 30 Nov 2026 08:40:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6DC18606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=rock-chips.com header.i=@rock-chips.com header.a=rsa-sha256 header.s=default header.b=fHenqE8u Received: from [172.16.12.48] (unknown [61.154.14.86]) by smtp.qiye.163.com (Hmail) with ESMTP id 567d522fd; Mon, 30 Nov 2026 16:40:29 +0800 (GMT+08:00) Message-ID: <5b757016-3926-4123-a02b-d7348448b535@rock-chips.com> Date: Mon, 30 Nov 2026 16:40:28 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: shawn.lin@rock-chips.com, =?UTF-8?Q?Enrique_Hern=C3=A1ndez_Bello?= , lpieralisi@kernel.org, kwilczynski@kernel.org, bhelgaas@google.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, dlemoal@kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/2] PCI: rockchip-host: Make the PERST# inactive delay configurable To: Manivannan Sadhasivam , Igor Velkov References: <20261104215848.2087944-1-ehbello@gmail.com> <20261104215848.2087944-3-ehbello@gmail.com> <179596114526.2288.5995800864070065544.b4-reply@b4> <20261129-rockchip-pcie-ltssm-order-1@iav.lv> From: Shawn Lin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Tid: 0aa22b9cda8303a4kunma8d2a1caede644 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaQ0JJVktJTRkeTExKHksZTlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlNSlVKTk9VSk9VQ01ZV1kWGg8SFR0UWUFZT0tIVUpLSE pKQkxVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=fHenqE8u+/69Nw9D1tVbSFL7QNQ4NoKL4gdM+RI/hp80VqX0ZI7sXt1ZLZp14yIAFnCUGNrzf8qg4AhIHg1jKXymvPoCjY5+z8e8+JrxfpyxTInAoRchMjEFlPul29O1seBkzRM0gKUDNPyCtIHAhhk4oGQ4rwiTWZ+Yf1bW+zs=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=RFgcZYh9+xSxFVbvcjNtpbZMe4mhIjp4IFjC6haEipg=; h=date:mime-version:subject:message-id:from; 在 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 >