From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFF8754769; Wed, 4 Jun 2025 00:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748998394; cv=none; b=UlCPxs/0Zu/sZea0tNbAzG/Z+zXlhxLIFWLWAQJdi/SSxhJEwtV6xtaiDXGe0pwM976khdMSntDiIAHcpd1M7DB8MWAUM1IHaVoP6GTjTbAJUttvxyFLe+/MYj2imOJXJR52hGSkBubCqnoK3HRv6D93QIJ3IWTJPeBhx+z/XAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748998394; c=relaxed/simple; bh=06/5TxgtZvM86mGzgWzAncs8N5P1lWHeSCmjUPHc7FI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=qPt120/IvufvCHmtbn6U0GnR2ja2CFlDJBGtf63/Y5m547IdO8I79pKl81sk4fIGXqSbwO4aNHTl7FJLlaKTj8TOnSu06/GtS48XRPHZ3JDPZhAMo/im4WI1/cx27Xj4v4dP9zLF+qRbfaSyeflopQLjV4AxM4taARwSa450Saw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oq18cfjX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oq18cfjX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6683C4CEF2; Wed, 4 Jun 2025 00:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748998394; bh=06/5TxgtZvM86mGzgWzAncs8N5P1lWHeSCmjUPHc7FI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oq18cfjXoQK8i6PCrwfP208GRduuCisosoTnKkXP1591m3MRP5oyKNMi8ga0Dml14 bpIRYS5KxQENUNT0lEyvZiyvhNHk+lbZsw+DuY5mx1YiCvPquCW4fvrpse+5S3qSfM LK2Qi0yGvgnJ/Jd9tlSZSFFwExtaw1WJ3Cab7OnnhFugWpN79Nrqk3TB18AN+t4aom SukWzlGoR27AY5io+gO26nM/f/3lArmzow2h+SS2r/rjahYjP1s/VOafiaAeTJrFrK +HJO9zoJttgzqXGi9+OfVabYI1fLRTK/1zcxgncHFEZWeF4NVFrnjUW6JhpJ2mIsmz iauEU6SoQhruw== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Heiko Stuebner , Sasha Levin , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH AUTOSEL 6.15 061/118] clk: rockchip: rk3036: mark ddrphy as critical Date: Tue, 3 Jun 2025 20:49:52 -0400 Message-Id: <20250604005049.4147522-61-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250604005049.4147522-1-sashal@kernel.org> References: <20250604005049.4147522-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.15 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Heiko Stuebner [ Upstream commit 596a977b34a722c00245801a5774aa79cec4e81d ] The ddrphy is supplied by the dpll, but due to the limited number of PLLs on the rk3036, the dpll also is used for other periperhals, like the GPU. So it happened, when the Lima driver turned off the gpu clock, this in turn also disabled the dpll and thus the ram. Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20250503202532.992033-4-heiko@sntech.de Signed-off-by: Sasha Levin --- **YES** This commit should absolutely be backported to stable kernel trees. Here's my detailed analysis: ## Critical System Stability Issue The commit fixes a **critical system stability problem** where the DDR PHY clock can be disabled, causing the system to lose access to RAM and crash. This is evidenced by: 1. **Root Cause Analysis**: The commit message clearly explains that "when the Lima driver turned off the gpu clock, this in turn also disabled the dpll and thus the ram" - this is a shared resource conflict that can brick the system. 2. **Hardware Limitation**: The RK3036 has "limited number of PLLs" where the DPLL is shared between the DDR PHY (memory controller) and GPU, creating an inherent conflict when GPU clock management affects memory access. ## Code Change Analysis The fix is **minimal and safe**: ```c static const char *const rk3036_critical_clocks[] __initconst = { "aclk_cpu", "aclk_peri", "hclk_peri", "pclk_peri", "pclk_ddrupctl", + "ddrphy", // <-- Single line addition }; ``` - **Single line change**: Adding "ddrphy" to the critical clocks array - **No functional changes**: Uses existing critical clock infrastructure - **No API modifications**: Compatible with all kernel versions that support Rockchip clocks - **No dependencies**: Self-contained fix within the clock driver ## Backporting Criteria Evaluation ✅ **Fixes important bug**: System crashes when GPU driver disables clocks ✅ **Small and contained**: One line addition to existing array ✅ **Minimal regression risk**: Only prevents clock from being disabled, no new functionality ✅ **Clear side effects**: Explicitly intended to keep DDR PHY always enabled ✅ **Critical subsystem**: Memory controller availability is fundamental to system operation ## Similar Commit Pattern Analysis Looking at the provided similar commits, this follows the **exact same pattern** as Similar Commit #3 (Status: YES) which fixed "unrecoverable freezes and rcu_sched stall warnings" - both address critical system stability issues through clock configuration fixes. Unlike the other commits marked "NO" which were feature additions or exports, this is a **pure bugfix** addressing a **hardware design limitation** that causes system crashes. ## Conclusion This commit prevents **complete system failure** through a **trivial, safe change** that has **zero risk of regression**. The fix addresses a fundamental hardware limitation in the RK3036 where shared PLLs can cause memory controller clock starvation. This is exactly the type of critical stability fix that stable trees are designed to include. drivers/clk/rockchip/clk-rk3036.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/rockchip/clk-rk3036.c b/drivers/clk/rockchip/clk-rk3036.c index d341ce0708aac..e4af3a9286379 100644 --- a/drivers/clk/rockchip/clk-rk3036.c +++ b/drivers/clk/rockchip/clk-rk3036.c @@ -431,6 +431,7 @@ static const char *const rk3036_critical_clocks[] __initconst = { "hclk_peri", "pclk_peri", "pclk_ddrupctl", + "ddrphy", }; static void __init rk3036_clk_init(struct device_node *np) -- 2.39.5