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=1796389754; b=1dw/G/Pg75FTLb+3EYTp4Q2WLy2Q1uF+5DfFBiTFktfPXhoi91ZJyp0dg8ss6HhCZyS0 L+/HhEl2ShZFs2DnYcb7eKizEwTD9iIuYjQpm/hNK4kJFfbWKO3ysOar6ShZM+IEFS8b0 OXszUz232NjjDLIniw4k/eVTbYSfibA33OqJ6Pt/EiO5VWSzEvTYMKiEpySgFsc90vo3d DPuI138/QGC5ltE1Gd+RVJOVt4f4FYuu4Jj5KdI8hZHrGvmkMl9r+8lu7erWygn9ragWc aPHg1m89k+CnEhN9MDZIon4fiJBXC1MdUKvbFT2EeocNhmwJfypAx3jzkthqdFbJ8Cg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389754; 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=oXTetrcuS446AZ3sKF9GHCIl8JiUMruE99r6T0MegKY=; b=19uq/NRwanLwzlMZBUf9zGUP7nX9Xjr1ZbgJssSYEdZKbGSlBVjvKqSRxaeh+sOf2wMW HeklRlXg+3fOQABoo7BXrajzcI/eYHBVVww3NWSx3ssPT4BJX3HcRCazpmutNx7Keqw2+ tlscYUsM86xTvdWvpNUYDsc3r9RUKvQ03LNP6njbE25iZ7wphaHIVeJGb9RB2Xjw6HmKo PFFisQgFZQkFcZRWqslHQzZwltYzQmPJZYraqbwIs0MgU3MXq3FETdz1BIn1m8brrVNs4 F1JB2vImg7+i5HKJQ+K6gnDUjO3FJpKZc+ZRIVf/05lGJkIzq07r5ZLqikhVujIjWlA== 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=jsHiqNb4; 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 F22E2606A32F; Fri, 4 Dec 2026 13:09:13 +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=jsHiqNb4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C40E1F000CE; Fri, 4 Dec 2026 13:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389753; bh=oXTetrcuS446AZ3sKF9GHCIl8JiUMruE99r6T0MegKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jsHiqNb4s9k9u38oAL1N5D8VPNs26GaRuG7ziKlcacFOdiIJcz3i2jpqbfXOb6hgT XJJyhg6iwAtnCzIiYgWbtqbXjA1VG8S9xWqNt9N7Ek8XWhYGptmoLVt1bJynyzU6If 9hdOIUrSaknDdymtwQ5cpevCB5is/Vv8QeyglRm8= 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 7.3 079/742] phy: ti-pipe3: Fix ignored clock enable return value in init Date: Fri, 4 Dec 2026 18:59:03 +0900 Message-ID: <20261204100637.185926788@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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