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=1796389759; b=VJ/qhPp6a7IhYQPIX1TStC2SzlFV90BcvtPyqp8Uq+8Vu1gp168LS7cM9vLRIsVOaA2m 7xC5T1slyEBG3eWFZnnJjjz+MyWtWBkVDgtEvlnxciiw5uCNF5U8YV6RRGxN31EjyxVJj ZSbjlGBOXsVWoeY8O344MVQDgzHJV7cKyOrCltMWmVzC7/RYbhDvQFd6ua5fZ/RETxaqF gQvSp/VnP36jrA5mnVhzN2uL2s9Qctu/8ZwihH9d7CKNvglSPiimfN+qhzng7Hc+XRede uNkzP49AV3TRG7pKVe6lHHq75SlDSIcoyKxTeS1XbZ0phtsFAEm7/dE0+obDU3H0Ujw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389759; 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=GNELusoIe4dxrtpaKePQh4z4qLV5ZgBxhEcVG3v6DAw=; b=Bfq3Gywq6/8Wo3k1m0npMWypIlTzwaOMLRisy5yXnGZYcRpGx32vzHLFEfHWQtAmPbEi QA+xvDP8l5fI8B+LOHqs0SlUtSjSs0/ygyZaEL0ftG7yKRbdhb6vgOFjLLNuTDr3DdSUL SIBYt6FIXmpdH5j4UW+M9MJzIrZrrN7SSVCCXH5DN/PLhFNHQ5T/S+3TbJPaEllhxEvpK QX09zgJW56UPlwSPvi1I9RZejaA6wvKdMjkMhYCcceq8RHnPtGLzVYDHTrqc2CXZHivVZ EQd6Y7/TBgZv6gAI+pRwY2jXATypWAUMyZAiAN7ncVjJi5gH1HeUsS5ypwtRYJs4adw== 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=1H5MdpCC; 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 6F3FB606A322; Fri, 4 Dec 2026 13:09:19 +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=1H5MdpCC Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF1141F000CE; Fri, 4 Dec 2026 13:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389759; bh=GNELusoIe4dxrtpaKePQh4z4qLV5ZgBxhEcVG3v6DAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1H5MdpCCX1d+ErrQKD6U1nqhyoCHas3vDTYDgvzOkzEUWaa33oHuFuvkZ9hs3/xc2 9ZQ98yLcqFkhIU3Jb+sLqEhmDSquSJejhzWF/dAWR80cPuTYrK7Djincf2er4T62Pc K3KJLFp9cOq2O+nMQIGCi4jthUHotsghEesKmjbM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Manivannan Sadhasivam , Hongling Zeng , Vinod Koul , Sasha Levin Subject: [PATCH 6.18 139/703] phy: ti-pipe3: Fix ignored clock enable return value in init Date: Fri, 4 Dec 2026 19:00:38 +0900 Message-ID: <20261204100631.584489430@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: 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hongling Zeng [ Upstream commit 64207b5bc6be7db5e75ba9b7eb271dbda30834e5 ] ti_pipe3_init() ignores the return value of ti_pipe3_enable_clocks(), which can lead to: 1. Unclocked hardware access if clock enable fails 2. Unbalanced clock disables in error paths ti_pipe3_enable_clocks() returns an error code when clock enable fails and rolls back any partially enabled clocks. If we ignore this error and continue, we access hardware without proper clocking, which can cause bus errors. Additionally, if we reach error paths later in the function and call ti_pipe3_disable_clocks(), we'll be disabling already-disabled clocks, causing unbalanced disable warnings. Fix this by checking the return value of ti_pipe3_enable_clocks() and returning early if it fails. Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function") Reported-by: Sashiko AI Reviewed-by: Manivannan Sadhasivam Signed-off-by: Hongling Zeng Link: https://patch.msgid.link/20260909122630.1313205-2-zenghongling@kylinos.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/ti/phy-ti-pipe3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c index b5543b5c674c8..0e3bc92187338 100644 --- a/drivers/phy/ti/phy-ti-pipe3.c +++ b/drivers/phy/ti/phy-ti-pipe3.c @@ -498,9 +498,12 @@ static int ti_pipe3_init(struct phy *x) { struct ti_pipe3 *phy = phy_get_drvdata(x); u32 val; - int ret = 0; + int ret; + + ret = ti_pipe3_enable_clocks(phy); + if (ret) + return ret; - ti_pipe3_enable_clocks(phy); /* * Set pcie_pcs register to 0x96 for proper functioning of phy * as recommended in AM572x TRM SPRUHZ6, section 18.5.2.2, table -- 2.53.0