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=1796380121; b=gPtoGarfCvnE6iTvLoftufrC0k4k02m55NQITtvp21UNGnytnQASA/4cNpeq/aNZtyhO SmlFh/tAzZ0h750VtaLjGpjsPzAtW58TPnTCmemElEFabxsmqHIKXPuWmPW5krXFWl+LK 4ve+vtcHWc193B2LK09zbzt+UGxHq25B6F3yziRi409wVU/Og1rPBfG+duWWBO4DKG64y Z1jcWRSyZzJlurkkYg5/kf2ae/Vc2CLzVXgCjum74RLjZ6XegF85Aylh8fMJWAPSZ7gq+ PFcwZ7EUVrubJrNX8ihZiti86WY25DwVv0/OLcDSA0EnlxNnFVjZG+mKAxuos5hJtnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380121; 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=X59x7Mcxb1+zVi4tAKO6iFGnSUr1HTp7uwUdUXNEtFU=; b=F8gdvC7do5TFeOsxa67/InbEZjirdyhiKez+3MTWvxqZHkhBOcpBuvtTaJ/S+ex3DoBu S6bj+G73w0+BkrJSTcotTnSQiYhaBLvuJh1muNy9B2eu6KjGMnWXH8wOV4vz2QWPWC+7n gXfKZjbNSFKINMGegYnN68pHbkn4Tn9zb8jz/ovg+G/mTjdgTXtpyDK734WDJgNKPApMJ cSqitgcdxQc/prH0VmvT2fvVTxkStL6lSuhs6vjn5H8fhcaqU/ZaPHTzzJ+/Yn7wIDw/1 7bvZH2K8UN1REtAnhGn7w3/NnRmLjTVFknEnp0RqCQmUIAlqMWEJPOBHwrXgIt8cFEA== 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=RkHLgD0r; 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 398F8606A32F; Fri, 4 Dec 2026 10:28:41 +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=RkHLgD0r Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F9221F000C2; Fri, 4 Dec 2026 10:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380120; bh=X59x7Mcxb1+zVi4tAKO6iFGnSUr1HTp7uwUdUXNEtFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RkHLgD0rZcYgWavuWP4fwwfvd4zEG7Y4thopsecyKPUPDDSpex8DqOHwfhurdSjpw BJaca5gqwVI/zI3h2YJ80nlgf7K31Oz8p8YIcOfLoUO5m7OLDJQIoF6x58VN80+164 HUaEXm4cZKMoBdY93ed/m/tUAtCtO9XpyV2A3sjw= 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 7.3 094/742] phy: rockchip: snps-pcie3: Raise the SRAM init timeout Date: Fri, 4 Dec 2026 18:59:18 +0900 Message-ID: <20261204100637.605698402@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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