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=1796389771; b=eO+GiGDDaRCiZeXdWpfqDcThtwTb6bJ/8J5Vh3kblV2KAg5UqnyxOD8tPh/CURDm/hAB +KIe0vbA2fvfyLiyoegQKo3CoC9lDQz90nNgnbFBFW2+1adcPlf4CP6H3amMYNfsKHxhh XaybNXDp6ZcF23+jNe6M6GJrMWy2TGEjC/b78YXm+cv9CG6BA70PusTi5p4ElotmrXvSp rCgUIJuU7Fv/ScrE95eqr1MkPFMEZcWSlEdYwQDX2HHGh/bg1YRwQQSJxi22eWRV1EN2D ZkRfJwCeELNlK82P1sCbUBtr2iEzkZWq28CG0W/tZxFgMuTbrDzaXAFuaFey2UmcRCg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389771; 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=UjxWnKEJFXLcSEkuaAV5Lsq9LhAbJUKl3cIzTJV2mdo=; b=V+6aKdcBYwwW2WzVLqPY//7HBdab6X6ZS5f4eW9dpqELfbnt4IZyKspZkpmnkjBhu667 0fK25i25ES7s/irY+GUSQyzbYW8cbDZz85GKaS3PaPk47rM8Z34ul14OsC/hdTracyQF5 uFzpOuQiex2RSLejz0xRC+We7HlXvT85OXPBwCr6E9jYlsDRsw+r7ZNy0ujH5Z74qOV5y Y/N6/S7kMyddrdtjva+ZxG39n+XfGQ7eOqegBYPQBSPk5xRY+23W4T8O2ZUg75RQf+voD P/pHKTW/e4MM7sJVgmpexnBj+Y1hdni5MMmLz17wvE3Tqm3ubZS/l0yn0GIWVkXQp0Q== 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=GcdlpBXc; 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 A96EE606A322; Fri, 4 Dec 2026 13:09:31 +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=GcdlpBXc Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FFD31F000C2; Fri, 4 Dec 2026 13:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389771; bh=UjxWnKEJFXLcSEkuaAV5Lsq9LhAbJUKl3cIzTJV2mdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GcdlpBXcBSj3zuzqE2hBBqKoQjyM8cql/XHwmuVE7vw9eUwQ/0i1pCoU7x6DQbyZM b02wvE0ScNnaGzoFM4GcbAOZlvFtrASNoKpNn8Nf+r99QmobccEXTUfwe/brxdOttV t2/XvXIPTWE8EBZ+O3OMrX4fuXw7fWoM9dk65IFI= 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.6 0856/1167] phy: ti-pipe3: Fix ignored clock enable return value in init Date: Fri, 4 Dec 2026 19:04:43 +0900 Message-ID: <20261204100724.414302593@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: 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 8e94d2c6e266a..91604c96f2294 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