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=1796383303; b=0NbXyFYUGjwmQQVSA+ulRC8pQOXEc8Whbh4WQxF2AT4rjrSIZau/8N5nt5WHAw+2Rl/J 6g+mihYICHSERYlJkPD50bwSP33u41VI1MUtd9rcEY5+zqd7Di+AuP2J6OyNWwpeZGSVA t1doTUq9V+zHzLIrZ1W7yvWnZjZ+PAVEpNaOswo7alac9rwTDlg+q2iYRTBvLkhTPZMNe YiGdfWurskcVPBZwMHVkyMzK2/kIds2Irm0RNvLj7NqMxNBmkGh43g3daMNtLmADmRffo a9+5lO8WYpuz+4+IDhiPMmjPOmwVil+qG/q/GxSM0kbkPVRaWsiKswyOzkf3G1i/WyQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383303; 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=oTMBMhaAowNwYoNIfmf1Y9KjsJBXhyAkR+ssP/PcHow=; b=KeeJOW10A+Ab1cx6iDSNtRag1FAzJFeF73ioT+vvfd/bpvItQwpw8LDrAIG1q3QpQOTZ 6H8Z/8wbNiMxd4XrK3IkXUOxfrcZs5FecxTlAOqvPSOK8rNVnHHwYeGjMMe46q89hDs3k +IdYiOlIdHNl0FUUkDN1VhxvUdsnz0mHE/8yXzUbNgJxbYr2zwaNybF+GIYU97QWGM2GF OEw/HohqkFqtSgI/JdoTPIyFB2F/A1oPixKq9c3uv4TCiq8V0G/SJjsMthpTzewKFDJNY WAO09gKo6shqScFz8CL4wye6gBuw0pVuKVWHyumdjHAH/+TOVXPZVMJay2YPAgB8mqQ== 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=GYxFP0Lz; 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 F1585606A32C; Fri, 4 Dec 2026 11:21:42 +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=GYxFP0Lz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 045161F000C2; Fri, 4 Dec 2026 11:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383302; bh=oTMBMhaAowNwYoNIfmf1Y9KjsJBXhyAkR+ssP/PcHow=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GYxFP0LzXz2uBB6hELIYfXDpKwfvp9OxeTu/QTbM1wpQ1JLrBvhwTanY9h3+fq73v gOF1zGmjYhA+v7S7MVy0yIsJ9iIxG6weL2UCElmSN0mg5WjB7e2uCMeBt0JS6VcfP4 UO3oBBwzeMV8P4MpMK3B3KED4gCiQE1wZOZFEyBg= 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.12 167/555] phy: rockchip: snps-pcie3: Raise the SRAM init timeout Date: Fri, 4 Dec 2026 19:03:30 +0900 Message-ID: <20261204100614.577632370@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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 4e8ffd173096a..ce7d8db2a7c5f 100644 --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c @@ -18,6 +18,9 @@ #include #include #include +#include + +#define RK_PCIE_SRAM_INIT_TIMEOUT_US (20 * USEC_PER_MSEC) /* Register for RK3568 */ #define GRF_PCIE30PHY_CON1 0x4 @@ -127,7 +130,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); @@ -187,11 +190,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