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=1796386185; b=uYKeD85USNl3yGQ/TdGC/35Zv4i3uUE5lQNEWt7YTALs6Czf4uiCRFOUfbHQGRwlaM5k hbwL9zEglPYqGaxd4eX21vACy1j9NYJXw0mwA8NtOmK72KKP2fytoaQgnZ1gw++eD3U47 7Mk1WbvgC8iVSnoxb/9ck8FhO7L13uqPqQ3jiwx5kcVzhs88jhlPj5ngr4Po9sa0BonYm 5CD6GoBL6AkIJ4w1ECizLRapXZh5UbGhqydBgreISwEngOZlvpQOfUPzd8TuGFBOggftT 0DF1u7jBIOdWwN8YRlqMKl6+cvCBYt/Jlkz7BhiFVGZZa/BIK3UZG6OVAKoLawVTmUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386185; 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=bE8vhwHcRfM3/wwTO5F7N51Rpi6kZhXOMLxeuMTIv0Q=; b=hoHoQ8fHaiwjzAqNsX0BwyK6lfRp7VdgtYfrdW8tssdx4vvx9c/b8vOLOumc+qoRaWZ8 naoiyu0tCiSKpgeNOUGzHaF7+iq6Q4IOph9no8DHn48AKpXrPyVicW3FQnllgRh40WEH0 FFlr4P8wyJpI5WQaWkjVWb5c98U4RbN9VDTcl3TmWOqoyEo3Zp9Fz9835ADSdpUW6MpTw 7tWnt8xiFnM7L795Tzc+OR5wuEDZHDqJ9K2vEpWGUuoKlhh/tKuhb+NkACkBx69q8EFvT 1bLWs6I3sv5U5pacvdTrZzSzoevW4kxKDHgC6VBL8KN6iTMSH15yDZnN40oHiWkZssQ== 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=HLBByCIr; 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 7B809606A32C; Fri, 4 Dec 2026 12:09:45 +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=HLBByCIr Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA2581F000C2; Fri, 4 Dec 2026 12:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386185; bh=bE8vhwHcRfM3/wwTO5F7N51Rpi6kZhXOMLxeuMTIv0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HLBByCIr4GQoWtWGE8qYPOJn01lmOkk/+YsrdnJW05KggJIbgtZSCm0vZ5O8GYkNj fnGx6V8p6ZOvlnfWSyPiGSzEWvSOGL7H5FbM416oq4mIuPtC/Fy8NeJtZqydbir/W9 c7JzSw6xnjTF8dI7KSSNKzq7zFS2Or29mdBMAml4= 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.6 0863/1167] phy: rockchip: snps-pcie3: Raise the SRAM init timeout Date: Fri, 4 Dec 2026 19:04:50 +0900 Message-ID: <20261204100724.593123285@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 9857ee45b89e0..921748d9c9fa8 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 @@ -120,7 +123,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); @@ -167,11 +170,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