From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388890; b=OQlMNoDQvGtI7mL7Llv7TtBpfpMb3tyB0O1IO7BwVMWl0nv0r/if3KVvbSgRykDzxJlo LLymYKelrJhA9r9C3XffmXB3A3RLFY5CiLx+Q+fPHAbC6dpXS6DE/oErK1HEZqW3BEU2u 1/xZ93+Mf3VXajWg8+/gFRqVNSEn4JgnccEVT9GkQkXDAtyP9SaKHtP0ROJcT5dvgkjjA wWsoABqz52xUA3Pvv9lwpTOqNN0L91SIbU6/hIS4gkzlN20m0PATekTxplzfy+Rqcf5On 93AgehRQqs4AxiIzHB6wF482TGNEvLIV0RDO82I9TDbH4TmGkr5ZWyGFCPFbasqcHHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388890; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=qwu73DAIEVrNSG0jTXUW2+umUpQmzqv+RIe+xg7yQjc=; b=r6WRs0FLyFiINz+2As83FwlqbVMmZiGo6IwoIhfMxHBPpg/mbxSPTWFjcCVXjJGX0WXs E1SPftnZdWttZ+E+s2m5aOb87eGqjvFPiLc/SIHyYrOrsdKEKDq6lVMrOMSFjML/RzCvo QeYhqhhToWnq+qQe0mdyKuMudwJaXFt2x0a0zayUUr3wVZAyBQiIdWdTe5GoYb2bwEAb1 HrOHcP54eOa6n4EsaK3/vvqHqF/Smdzln2VWjTpXZ8jq9G5vqKUj2qOJjPTw0mwn9cn8k gjHTzaVCD90RGT9jRN4s9pdhyZ5E5IL0aH57eOfQ8hK1+hhqSlxIoE1SsrzWT/b7mZg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=bqYFB2On; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B770606A33B; Fri, 4 Dec 2026 12:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=bqYFB2On Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BA2A1F0092C; Fri, 4 Dec 2026 12:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388889; bh=qwu73DAIEVrNSG0jTXUW2+umUpQmzqv+RIe+xg7yQjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bqYFB2OnsKgoI6+jEqnnE7w7M6KMCiRpsGlatA5lSwg17gQDrvHnz3UhOw0MSr+SE kUWFXeasm6X1TMGEkvZv9FXkN9CUWsu76l6CZDfH6H37uv36BJGVbGgP5BsjYBw6/g lhnrqOohXFO60cUBYA5QsRvngQoRVWLfsFSGd+X4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sebastian Reichel , Manivannan Sadhasivam , Shawn Lin , Vinod Koul , Sasha Levin Subject: [PATCH 6.1 0788/1059] phy: rockchip: snps-pcie3: Raise the SRAM init timeout Date: Fri, 4 Dec 2026 19:05:19 +0900 Message-ID: <20261204100704.443510148@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shawn Lin [ Upstream commit 7c2a2268bd3ddf3b2c674ebb7557ae24c22309d7 ] The SRAM initialization of the PCIe3 PHY may take longer than the 500us currently allowed, especially on a slow power-up such as at low temperature. In that case the driver reports lock failed 0x..., check input refclk and power supply even though the input refclk and power supply are fine. Raise the timeout to 20ms and use a named constant for it, applied to both the RK3568 and RK3588 paths. A non-zero sleep interval (1ms) is passed to the polling helpers so the CPU is yielded between reads. With sleep_us == 0 the helpers tight-loop, which would otherwise burn the CPU during the now much longer wait. Fixes: 2e9bffc4f713 ("phy: rockchip: Support PCIe v3") Reviewed-by: Sebastian Reichel Reviewed-by: Manivannan Sadhasivam Signed-off-by: Shawn Lin Link: https://patch.msgid.link/20261102005129.3745527-1-shawn.lin@rock-chips.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c index c6aa6bc69e900..8c1da05de647e 100644 --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c @@ -17,6 +17,9 @@ #include #include #include +#include + +#define RK_PCIE_SRAM_INIT_TIMEOUT_US (20 * USEC_PER_MSEC) /* Register for RK3568 */ #define GRF_PCIE30PHY_CON1 0x4 @@ -119,7 +122,7 @@ static int rockchip_p3phy_rk3568_init(struct rockchip_p3phy_priv *priv) ret = regmap_read_poll_timeout(priv->phy_grf, GRF_PCIE30PHY_STATUS0, reg, SRAM_INIT_DONE(reg), - 0, 500); + 1000, RK_PCIE_SRAM_INIT_TIMEOUT_US); if (ret) dev_err(&priv->phy->dev, "%s: lock failed 0x%x, check input refclk and power supply\n", __func__, reg); @@ -166,11 +169,11 @@ static int rockchip_p3phy_rk3588_init(struct rockchip_p3phy_priv *priv) ret = regmap_read_poll_timeout(priv->phy_grf, RK3588_PCIE3PHY_GRF_PHY0_STATUS1, reg, RK3588_SRAM_INIT_DONE(reg), - 0, 500); + 1000, RK_PCIE_SRAM_INIT_TIMEOUT_US); ret |= regmap_read_poll_timeout(priv->phy_grf, RK3588_PCIE3PHY_GRF_PHY1_STATUS1, reg, RK3588_SRAM_INIT_DONE(reg), - 0, 500); + 1000, RK_PCIE_SRAM_INIT_TIMEOUT_US); if (ret) dev_err(&priv->phy->dev, "lock failed 0x%x, check input refclk and power supply\n", reg); -- 2.53.0