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=1796389774; b=QvRN7lCCzpDafCeuH3Bjwg/9GXqdkOmLuPrMhzjrJrIN6otVcVWfLH9yTRGYDvtFkQ5F ARm5TxpsbTP8X8wBPkALCTlnAePnMZ0hNoJqVI+W0hifzWhIEOPwUy9CjDPTTKUPSHcUG T36u6X7CE5mh8FARF8sX9tuMOWsDFj/QlJjIvyHgze7Gm1gm+U0xV2DfixxnhN/DfnqJl lrcRXsx9W1WbJ1tQFMD7LG/4N0tn/sEIp0aZwU9mVcB9oflH2wowdwf7PcJOke+E9e93Z xvWNG07juXnFRbnfbsmWd/Ozfp9x9EIfjS3zwzkvvtSAKGPl6MZBUKoDUT9xGi6Ho6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389774; 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=+u+HqdA9A2asaCooitW+ca16sXYntL5Bomn40RVeToI=; b=5tkbvhLaKyGtTaFySVR2Vd0seG9xt/f3W59WnM1WmEbgSghjVkWYBIE6nRPCJV7iJ+ks T6DoxKh02k4jSgQdZhGvsxx3m3LrEPD8ucmc8CIQA7ja66nE/issLNYZJtgcopgppmwwW +N9e62GUCN5xCNxwXTx2CDY8wdIfLlY36Nos0X6oQUFR2Arf8aAAcCEr3yJO6I1gH/cBN oLLNJgFRfrHMkAd5HA45Ly9LDxuAK8GRzuDaeLEH3DHOIyWvawG34nnJp/HPdiKUdLVZ2 QDBWEsldYj4QOUzU9UM9NjIJadPW/DPomChPjBFaxeAtwzedP70xlFsGHviwZ10alCQ== 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=uXOUPSWp; 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 1331B606A322; Fri, 4 Dec 2026 13:09:34 +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=uXOUPSWp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78B3B1F000C2; Fri, 4 Dec 2026 13:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389773; bh=+u+HqdA9A2asaCooitW+ca16sXYntL5Bomn40RVeToI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uXOUPSWpGG5SIF4waJtocyYylxXMC/+uWfVljYuPsOH0oMQVLKmH0Ua7Al0kxlm/+ hoe00YZuHjnO8AVz9R0X602vFmGAPm9ocpH/xi65ga5SkRIGIERaoigEbgcNLoeqqg t2aio0OM4Nsxbxll0XqucX40vV/zm2DuJiYAXUDc= 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.1 0783/1059] phy: ti-pipe3: Fix ignored clock enable return value in init Date: Fri, 4 Dec 2026 19:05:14 +0900 Message-ID: <20261204100704.303344175@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 57e5bcfb6910f..e02030e8f8b9e 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