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=1795024503; b=Ef8r+SndRzV34agUAhxM8yy7trlpn8uOxti8y6nyC5O1QEQGSZgpTD91vrwBVpwOpRRQ SO+kqUctx2K1qDECM/PDdl4lMMXUOPBQX2mzSX6vrGgpDt3kv9KaVOKhPMXexyJQ43IVP 2Q/MFUmwhCIzwyXIt8qRI2sVOoLO8npX4tKSM6BjnOsDYxe9Va4abwOuIbGgu5ib2SiSA uZ3J9Qo4kwkc1HwQtWCy+hhk8s07amFagFfvOmbuYPSdi0WKZvNvNrINEoTzUvRCGMnC7 F0ECBP5xhM3ki62lHck6AnxLyVdRW9Mb+7xKhAoZ5WM/7wc7FelFbzrISS2/PAH4ekw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795024503; 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=oA3UoD1f6ClTkyuaxyT+R1cMouf2DpEssF6wPOUleHM=; b=hsc2RoJ7n8wz88F919GyDu+mkH3iPkQUVcQh5oLFo0BraWYXRqLQGinBKUE4e3R5ZchY zo3+VuSK7C7IjegTYyjvK3ImFn9q4qcGKTB6Ve+ap3z4QcdGPOtSBMDgf7VvvlfWb6IUz dXEl/SwqOWQk7rSOVjZh3NcdKUWIgXsumOShJsm0ceSBcVsDrVL2KP0QAtJJMUevY81hU 61/ofNsJ+8xFVeXoElSj1pZ6B03kNQmC+DN6gluCVFADTXyNSQXeaOoJXhAiHoM5xHFnI TSJ3HJLc7cDlv2OdIQwjLcImS3qj9FNIFemDOfBrcMzrLCDv3QZeIohe4bwEaHzDTMA== 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=1oIP1EUU; 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 EBE66606A33E; Wed, 18 Nov 2026 17:55:02 +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=1oIP1EUU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F1721F000C8; Wed, 18 Nov 2026 17:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795024502; bh=oA3UoD1f6ClTkyuaxyT+R1cMouf2DpEssF6wPOUleHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1oIP1EUUtealluBJxloXgiYfocs38SZ1M4vkUHye4nFkZA5/A7X1Vd2ajGVZSa+x2 GRFkg/QJroYCjEZw9Zt4DoRbZHVQEbkejPxfsaoaiFN1/BGKhNy8jEOW2M8l3EZb94 h3BLfKXaINf79D1fWj6STjAKDH5tXy8PGmqdZCaw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cezary Rojewski , bui duc phuc , Mark Brown , Sasha Levin Subject: [PATCH 6.18 0749/2151] ASoC: mediatek: mt8183: Fix APLL enable error handling Date: Wed, 18 Nov 2026 15:41:24 +0100 Message-ID: <20261118150149.304003265@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@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: bui duc phuc [ Upstream commit 30cf48383006579d7cd35380cc6e766260b72bff ] Currently, the mt8183_apll*_enable() functions call mux_setting(afe, true) but do not check its return value to handle failures. In addition, the cleanup paths of mt8183_apll*_enable() do not call mux_setting(afe, false) when the enable operation fails, while the mt8183_apll*_disable() functions do. Add error handling for apll*_mux_setting() and call mux_setting(afe, false) in the cleanup paths when mt8183_apll*_enable() fails. Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver") Reviewed-by: Cezary Rojewski Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260903045203.175337-4-phucduc.bui@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c index dd1a5925af96d..06556689976db 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c @@ -376,7 +376,9 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe) int ret; /* setting for APLL */ - apll1_mux_setting(afe, true); + ret = apll1_mux_setting(afe, true); + if (ret) + return ret; ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]); if (ret) { @@ -405,6 +407,8 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe) ERR_CLK_APLL1_TUNER: clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]); ERR_CLK_APLL22M: + apll1_mux_setting(afe, false); + return ret; } @@ -430,7 +434,9 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe) int ret; /* setting for APLL */ - apll2_mux_setting(afe, true); + ret = apll2_mux_setting(afe, true); + if (ret) + return ret; ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]); if (ret) { @@ -459,6 +465,8 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe) ERR_CLK_APLL2_TUNER: clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]); ERR_CLK_APLL24M: + apll2_mux_setting(afe, false); + return ret; } -- 2.53.0