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=1796389764; b=Y3W8tzydCFgty8mmXJDzgVNbDiAPmQT6q6jMa2XLq6nnploLgiRFR3bPJbc+uwaUORvT qtNZyIEFuiic4ZrbsbOhG69msQIa6oSPZbGWX+yiV/hMQyyPH9nUEJC2nCVkRWJCA2HpM DMGGLw6WB3mUswhDjU5RwzgDZTlIOggvAc/ZsMFD8AcazSMOJ8fys6cJKmMvCJsMtxbLF jjYoz2M28ZFwGjGBOTVwdGYt0Tf5tzji4C6cton9eFqhrbC3Sd09x3RDcbdHoTKjYL40D 7pDY6CCyH38EmVrijoO5/1M309z/aGk9mzDL1+Y4I1HWuUL5YR4Xri+UiHy+fniod7w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389764; 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=2WR/S9Uu4fOW9VqaYyJ6Pj6AF/fOVT0lGqtPehjVUXk=; b=SKUQc9lFmnPeZ125X1ZHTjORNFyFDhMD8d3Pz+Ynhgmfbv6f2YWqALQVfT2DnpIA0oBY jbRKi2HJA+/S602PqyzOqEHLdynL6cnJSPc0HtL3FeQS8g9ZB0Ztq+eIzz0Oau5C8mU9B kQ9dn6FHLijHzJogPZx9q+uJ5IvEaCJBgWMGLCOxuWx2pVV2394/iS4GhmbRAIlRUIm79 8lJkkbbgzkSB6fM1fJf/z/y1rIqZZTRq3RkTjAN9AW5UupObNlcsx9DFBDtEzIHL8qgEJ 5XO6Paj7Hv/2GsrRQ1LxDoYkl8wfr5Tp27Yu7o3SiQDiHRGq5rMJsdErZZsauSAK0eQ== 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=ZFGedxwK; 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 3290C606A322; Fri, 4 Dec 2026 13:09:24 +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=ZFGedxwK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AE751F000C2; Fri, 4 Dec 2026 13:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389764; bh=2WR/S9Uu4fOW9VqaYyJ6Pj6AF/fOVT0lGqtPehjVUXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZFGedxwKy3twsLpkANlGr0E+7ScGP28KKqjrfs79nvxqYZs/Kuoof8IxFPoesyALu ULKpJoQZ01zN6gwEsceH5AhNusOGqLWKIsqCxP54VjJ4XKCHa/3J4zTMcuVcVwXVin tnnl/BJtPBZ0QMAgNaohbPXkWMdmEuUEKE9VI5bA= 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.12 160/555] phy: ti-pipe3: Fix ignored clock enable return value in init Date: Fri, 4 Dec 2026 19:03:23 +0900 Message-ID: <20261204100614.328679047@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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