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 27A1947F2C8; Thu, 20 Aug 2026 17:47:13 +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=1787248034; cv=none; b=D5QaKov7jYPnZW6THMwV9sVZvy6S34/IWK1sRti+PE3ZpRrAxUVdDPHhrPPAQH3kkaks4PE/UhcD3Gmj2E9/ZnkSssyg+2AOZIPCXO4O4oS+mNFG7GlpATYf6hx0r4mympBfnL6YuroEG8l/HJHCIwHMB+x57y3kDMqC5W3lRO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248034; c=relaxed/simple; bh=ZJpCAG7g7ZtV82lttDVV8WSt4OhU8Ewj0lCw9XdGTtw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hSx3ROHDxpl86G/kZuBr1ZWPqWu4xV3xT+fAaVlTpAZYrT+KighMvRpFygt7n68O1dNNXZReXscm4G2hIF1+9s8uhpKJvkJm647Nf+VcSeFFjoabedW9cV+688Cm50iuA9ptYtW/AtU+AmHf0/EiRBZENWrtr3VWJXDw1FK3vsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vsrBZPt/; 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="vsrBZPt/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 824861F000E9; Thu, 20 Aug 2026 17:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787248033; bh=Mzpplf1cYk2wRtgIr8Rr7UX4BQlnG7VXMyLZKMZBFlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vsrBZPt/iRcflgyEFeG7xiP8+A1PSq9CgTIhKPcLOJKZcgfor+gUwTeYmF8hzL6Cs 2SmTxcS6clhtF6EG0+tsfJjs3LlOUzVzi7lYSa2A74S+6TDilNobSOxGV9Dz8GEBrm AaoIRLOihXxJnXG7aZd2rypsx3g/P1Cj1kR/Syvo= 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 , Sasha Levin Subject: [PATCH 6.1 087/303] ASoC: mediatek: mt8183: Check runtime resume during probe Date: Thu, 20 Aug 2026 16:53:43 +0200 Message-ID: <20260820145255.918331369@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145253.200766705@linuxfoundation.org> References: <20260820145253.200766705@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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cássio Gabriel [ Upstream commit f0334fbfd107682d0c95f3f71e25f6127038e2b9 ] 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: Sasha Levin 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 @@ -1143,17 +1143,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(&pdev->dev); + ret = pm_runtime_resume_and_get(dev); + if (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; } - pm_runtime_put_sync(&pdev->dev); - afe_priv->pm_runtime_bypass_reg_ctl = false; - regcache_cache_only(afe->regmap, true); regcache_mark_dirty(afe->regmap);