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=1796381821; b=hMLG/U/WK1uDf8dymnPo2WpMuOSE+e051zIbz2cr4NKn2ZhY1wRye45ejsBv4kB7LvSq pzWvFbyGYT5+0AZp1tYVRF+th2/Y9nKSJsktddUsd7QcngsWdj9L1v+GN8vB8JXkGuUqV CF7HD3ay3pHPwPyL/CLliC+HXI8NWOlbUvcBKsrd2vAqxceDllj8cu5aA3PFJr18ZPDM2 cJsBY+c4eDQl24d8cT2vy1Yyp94RRqccCPtciN+WY11/saf/a0xYKydwql9U/IAdH5SmU 9+k8xliasI9HawaeexuBjL7Ob9Bv2XQIIGFzEml5CGs8g+PJqjnehAtB58qorg7T7sA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381821; 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=PISDHsU9jx9x+rWYi3NggVpNdCvRAqmByqrB6D6+1i0=; b=U/EYynE2stt1J+TkIYKxICOnHblEhcinMdGuHMck7ShV7Q5Cl7jVUuF95hAPPSu5iFu+ LElyW7RfO4PtPk7B0SfKIBnpcixqNOqAWkK1ndTCkhj/vkBhPRAqkhZbJPv83gqCG9xWN kTrNeYiq2kpJdZnS5AqeQvjRavuaNH1m3e+ITJ32iTJmOwqP1zPsOQ5GgtJID/YaAF1Kk CH5WRrq0E5+UqzSQg23haDk6jlB0LmZ9fF5ZPk1Ex2hlJwIBgYwOoLDoYjsRyDGpB66I7 upPMHP03VyUad/sXG6x29stH1yeAe3UFJNStLQSkEk0daG23GTI7mQ1jgvpP0NIi7qw== 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=2DLbIvNg; 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 8C5E3606A322; Fri, 4 Dec 2026 10:57:01 +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=2DLbIvNg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 064CF1F000CE; Fri, 4 Dec 2026 10:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381821; bh=PISDHsU9jx9x+rWYi3NggVpNdCvRAqmByqrB6D6+1i0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2DLbIvNgb8EcX84/Z+eEwRtf+YMEeGeVhL7og40HJ/wTDrvmxWzGHzvnwqYT06sav TN0dJjRvwh4MOs64nvP2jCJ5JYIipt11vlWQQf/bWRivqBILWMXLKgpwZbMreaIFs6 crNmzRAjGC849GJEtdtZPxagIhU10Z4fCisisy/g= 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.18 147/703] phy: rockchip: snps-pcie3: Raise the SRAM init timeout Date: Fri, 4 Dec 2026 19:00:46 +0900 Message-ID: <20261204100631.804733719@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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