From mboxrd@z Thu Jan 1 00:00:00 1970 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 3A1204FECEE; Wed, 30 Sep 2026 15:37:32 +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=1790782659; cv=none; b=SBBbRhGjwKxxq2bGSOO2vcDKRhH+IOJMXoQNz0CSiUxD+uFZLW4z7k6pWOw+Jslq4VuOgVFcI1daWsQTw1JwgOgm1h/1cn5l511XJu/KhxSigfU9O1LgvzmHRO4A7rNPC8xkbBkYNYVxS+YfXdXE3dy5RXeI1Ur9Ad/A5TST3Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790782659; c=relaxed/simple; bh=6YSFPmCmErydNLCdl9x21b7XSHG6sRljm7ejuvUufz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YK/f4Kj2UqknQisxTQqkZ2JEG81PJRRypLSSnWf+8Sjq9XM27EniP/m+UC2sh7vINQAzjEEUZLwCR1BBHDKtNMAbvNc++L3vqtKDDkJYVIsa6VlCTXZL8PH678Pwhu5BSlia1WDpk/st9O969Dzrmg6drW3VhVIDZ/B6p3yiz40= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=diBWpqH5; 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="diBWpqH5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33D711F0089C; Wed, 30 Sep 2026 15:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790782646; bh=Rre9v49rcTa0NaUh4tAOJfVRd3I2cTHCXOrHmC0SgS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=diBWpqH5Ui6iWyerK88YUUnMcTkcroenzYx1Putq7lgQMq2aezjlFwLAq3Qel3HE9 sZ7eZQ/ZHDshmiV8XxoIzBBz+VfhGsNGPDThIKqVusSk9Vk14FkC7nzcrm4Rjga+JU Nwo3R/CaWzZDEIymyQ+PglshQa02iU13EYcA+kNc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko AI Review , bui duc phuc , Mark Brown , Sasha Levin Subject: [PATCH 5.10 121/595] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt Date: Wed, 30 Sep 2026 17:20:14 +0200 Message-ID: <20260930152350.342208359@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152347.700140858@linuxfoundation.org> References: <20260930152347.700140858@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-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: bui duc phuc [ Upstream commit ee7b5f7b39332febf917f9ebf212842cc9379815 ] rockchip_pdm_set_fmt() calls pm_runtime_get_sync() before accessing hardware registers, but ignores its return value. If the runtime resume fails, the function continues to perform register accesses while the device state is undefined. Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() and return early on failure to avoid unpowered register accesses. Reported-by: Sashiko AI Review Closes: https://lore.kernel.org/all/20260522110302.349421F000E9@smtp.kernel.org/ Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260602101608.45137-6-phucduc.bui@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/rockchip/rockchip_pdm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 94cfbc90390ba..5d7a12ca4c819 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -260,6 +260,7 @@ static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai, { struct rk_pdm_dev *pdm = to_info(cpu_dai); unsigned int mask = 0, val = 0; + int ret; mask = PDM_CKP_MSK; switch (fmt & SND_SOC_DAIFMT_INV_MASK) { @@ -273,7 +274,10 @@ static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai, return -EINVAL; } - pm_runtime_get_sync(cpu_dai->dev); + ret = pm_runtime_resume_and_get(cpu_dai->dev); + if (ret) + return ret; + regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, mask, val); pm_runtime_put(cpu_dai->dev); -- 2.53.0