Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA1593DC4C2; Tue, 21 Jul 2026 17:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784654159; cv=none; b=UXVJ4KVTQX5jMv02w5MjuA/mLUd/5SSXH/1xYRK9lXSMgsiAisdn54co1Wt320i2d5lcsiTqhGlLrOcAaB8Z4lDlG3i+VuK+M0nToqvwEvJ5vMZFO/XIxJ3kjfnDHDk/0LC6zpA/LKozRkYtwTiDOO5AZ3jv4yVtsfMBHdTtEcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784654159; c=relaxed/simple; bh=e4la6m9TGcVPt4MN7nrBMkaMzikp4l3mBsZ5mwuAl9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lvfKc0YRwLwIL7i0J/aQokcz7gEWPAHw/Q8tuGGnwL/XIgrLbWZlVBcSI2Ed/YZStdX6voJ4GZ5uAZzucaLy8SZzQCaOQBphUHSOicO3NwBC7Kq6RiM5+QuKSzEPtfByPAekoYnlO5c6+J+XVq/K/nKmZHVKU/V/1UmEezK38wQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EVDF2CAe; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EVDF2CAe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED01C1F000E9; Tue, 21 Jul 2026 17:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784654158; bh=sfKOZ6qeMgIP+Hz/iVgFTV3SStqvTEtz2c90rB0cFfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EVDF2CAeKMXPvDDQtn3g+n3fhfUcuFN4zgKmotIuo+PGlVNu+u65xGpPVA9cH8Nxm DQSMPtq/Sb41qbtBq9H9mojlLMxnIr/975q4UDASVoD/A+kTTeAW0sGi5QLCS4hKwj 3k0p/NZ3/K16qApTHVHBvJ/i19fO0pNPjpoWOmjg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?C=C3=A1ssio=20Gabriel?= , Mark Brown Subject: [PATCH 7.1 1598/2077] ASoC: mediatek: mt8183: Check runtime resume during probe Date: Tue, 21 Jul 2026 17:21:11 +0200 Message-ID: <20260721152630.464006511@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152552.646164743@linuxfoundation.org> References: <20260721152552.646164743@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cássio Gabriel commit f0334fbfd107682d0c95f3f71e25f6127038e2b9 upstream. The MT8183 AFE probe uses pm_runtime_get_sync() before reading hardware defaults into the regmap cache, but does not check whether runtime resume failed. If regmap_reinit_cache() then fails, the temporary runtime PM usage count is also not released. Use pm_runtime_resume_and_get() so resume failures abort probe without leaking a usage count, and release the temporary reference before handling the regmap cache result. Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel Link: https://patch.msgid.link/20260527-asoc-mt8183-probe-cleanup-v1-2-4f4f5593c8d1@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -833,17 +833,21 @@ static int mt8183_afe_pcm_dev_probe(stru /* enable clock for regcache get default value from hw */ afe_priv->pm_runtime_bypass_reg_ctl = true; - pm_runtime_get_sync(dev); - - ret = regmap_reinit_cache(afe->regmap, &mt8183_afe_regmap_config); + ret = pm_runtime_resume_and_get(dev); if (ret) { - dev_err(dev, "regmap_reinit_cache fail, ret %d\n", ret); + afe_priv->pm_runtime_bypass_reg_ctl = false; goto err_pm_disable; } + ret = regmap_reinit_cache(afe->regmap, &mt8183_afe_regmap_config); pm_runtime_put_sync(dev); afe_priv->pm_runtime_bypass_reg_ctl = false; + if (ret) { + dev_err(dev, "regmap_reinit_cache fail, ret %d\n", ret); + goto err_pm_disable; + } + regcache_cache_only(afe->regmap, true); regcache_mark_dirty(afe->regmap);