From patchwork Sat Nov 7 08:08:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shao.mingyin@zte.com.cn X-Patchwork-Id: 3920 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 4D0341C5EA6 for ; Sat, 7 Nov 2026 09:11:49 +0100 (CET) Authentication-Results: mxe881; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27315-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27315-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 7EEED37DBD for ; Sat, 7 Nov 2026 08:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794038916; b=Hhaw24hcPnl8ABabnZMhltPAoV8xkbDZ4/sXfxJlUFoIolzdzXlixtvapgxYpTFqXXYz xG70mw/8HvyalQYCmK8CsmsbeCJvK8SJ9k2fyLClcBMglcRuzIvfhtVu7gOQrw2Ug0jWv ANXSrOybgixT97TPMldY8WBAeTf0oycfsO9hpZmSPaZ5w/HF1medbk/NWqHWeJDtKGOvQ 6YqeoUtMOcpGuw0d8Jqfhly+GtEGIJ+psdRUVqID8G38M/KVD8JiPaS9kzZ2yC2hs5DdL G4Jc2gNDuJiBBmnetCy7sopj/lTRENUYotLxfygGgnUmP5uhB+r9jvMWvGAMTdJyoGA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794038916; h=X-Original-To:Received:DMARC-Filter:Received:Received:Received: X-Zmail-TransId:X-Mailer:Message-ID:In-Reply-To:References:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:Mime-Version:From:To:Cc: Subject:Content-Type:X-MAIL:X-TLS:X-ENVELOPE-SENDER:X-SOURCE-IP: X-CLEAN:X-Fangmail-Anti-Spam-Filtered:X-Fangmail-MID-QID; bh=EG+y83gpbL7hXWFwNvkWQQTjH9VbIPQJjGC4yYN624w=; b=jPlO8/iQoQPkZ1FjV9PjCPkEIoNEnCwwll6NI+T5SplWwUOcyERG/zF1RhutSFzrdFnL yAduamJJnsJFRWGcjmT1p86EMVOoT4HoRbE6kKlsRUvUDSBp9KgjgjUbDkt4yKt7gcP3O 2CuH5ewvVL19gIAkHB5XiENPLYFwiT1K5XmsveMr9fO/Mptjw2VWU1GsY7h5y/3ktAGkX kcxj4zyHiFOCODCeAd5WUzA+kjqT+CKJPCH98hqX8fxWcWCLV50aPIgTZRd3kA71ntF10 tkSgIycwfDcJRTqjY92xzqlhGYbpPT0J04vPY7w+RMZKyierDTwjE6BlpjCcAwfiUYQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95254606D824; Sat, 7 Nov 2026 08:08:36 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=183.62.165.209 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794038916; b=oPYJyiEFPIfuokETHLF2IjfbgU2y05nykYbmTYl4gBPucy7mfhAmsPdLCAQ80ZFEQksJ DMqf+wC03i1zhsPEkhJAXGNnTZNrwRoTOIp30Tm2hXJ9pg72kVRtXWz9gbqiFzp3OJqWT 8K91NyMgb5IoB2tXhAOZKTEMNL7nExYJ/ZDKAXZbD6hOA3uVEXNlYMdTwleDmi1IK8wlf R2aJR3kc9qopUXxic4oEGcoTGp8txFM509/T0dFsa0HZJ+sM8xmwZjpPdzCaPXCSa0FBx eSp1Gil4xvv0i+crHmf7AyPCXtqn0pjZFtxrbBc2PmGT/u3IOTduZ7HmUQkXu2Fd+Vw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794038916; h=DMARC-Filter:Received:Received:Received:X-Zmail-TransId:X-Mailer: Message-ID:In-Reply-To:References:Date:Mime-Version:From:To:Cc: Subject:Content-Type:X-MAIL:X-TLS:X-ENVELOPE-SENDER:X-SOURCE-IP: X-CLEAN:X-Fangmail-Anti-Spam-Filtered:X-Fangmail-MID-QID; bh=EG+y83gpbL7hXWFwNvkWQQTjH9VbIPQJjGC4yYN624w=; b=Mkquc78k/FyT3O5w1MbJPG8yKUVGVJ/mDJQCyw9APWZTkd9F3/r+EEYLPOx8L9YtfOAy mnDKrClyGIjVkghKFdxN6TvZLjVrDbWLu6M34SiMuXm6huDnn9PufWy+7xjoJl3O3o1ft DLWaiQEq/WTqe6122yjW9RpY7y3RPYEyXd0HS+ZvbUaTuV52ttBcD/90HSZDpxpZEBv7X ZLaQMLnbiZqvm+XOE2p2iyZz6r074f9mP+iLThOCnl77Dhq5gTGvZXlhLetLl0szu8uaL HOImXt/m24BV2G39MgmKauSyZiUjRYxeuca5psgt4V1Q/eNNd3XaPzRGJGxg6sjGipQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.remote-ip=183.62.165.209 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DCD0606D81D for ; Sat, 7 Nov 2026 08:08:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0DCD0606D81D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4jM7wH5Klvz57HS2; Sat, 07 Nov 2026 16:08:31 +0800 (CST) Received: from xaxapp05.zte.com.cn ([10.99.98.109]) by mse-fl2.zte.com.cn with SMTP id 6A788NtQ096673; Sat, 7 Nov 2026 16:08:23 +0800 (+08) (envelope-from shao.mingyin@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid32; Sat, 7 Nov 2026 16:08:25 +0800 (CST) X-Zmail-TransId: 2afa6aeedc79740-932de X-Mailer: Zmail v1.0 Message-ID: <20261107160825704ak9coG8uWvEC-daLg4OkT@zte.com.cn> In-Reply-To: <20261107160815352Q4eO0zXOX0KF5AwEbOJ6f@zte.com.cn> References: 20261107160815352Q4eO0zXOX0KF5AwEbOJ6f@zte.com.cn Date: Sat, 7 Nov 2026 16:08:25 +0800 (CST) X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 From: To: , Cc: , , , , , , , , , , , , Subject: =?utf-8?q?=5BPATCH_4/5=5D_ASoC=3A_sun8i-codec=3A_fix_bus_clock_leak?= =?utf-8?q?_in_runtime_resume_error_path?= X-MAIL: mse-fl2.zte.com.cn 6A788NtQ096673 X-TLS: YES X-ENVELOPE-SENDER: shao.mingyin@zte.com.cn X-SOURCE-IP: 10.5.228.133 unknown Sat, 07 Nov 2026 16:08:31 +0800 X-CLEAN: YES X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6AEEDC7F.000/4jM7wH5Klvz57HS2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Shao Mingyin sun8i_codec_runtime_resume() enables the bus clock and then calls regcache_sync(). If the sync fails, it returns without disabling the clock, so a failed resume leaves the bus clock enabled and its enable count unbalanced. Disable the clock before returning on the error path, as sun4i_i2s_runtime_resume() already does for the same failure. Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec") Signed-off-by: Shao Mingyin diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index 2e4a205e4e56..e7d5c81ae1ef 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c @@ -259,6 +259,7 @@ static int sun8i_codec_runtime_resume(struct device *dev) ret = regcache_sync(scodec->regmap); if (ret) { dev_err(dev, "Failed to sync regmap cache\n"); + clk_disable_unprepare(scodec->clk_bus); return ret; }