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 EE37F364931; Wed, 30 Sep 2026 17:56:20 +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=1790790982; cv=none; b=WeyUMxHrNwyFs2ulI7Oe/JoibqY6G9JTGXt/qagppQx+GsyeDqIZPOKl/o/HUZ4FMl97hzfwn2DZudH+TowDuXAOtQdohtlkhAoIFDFTI8I2bncVfKlzCsxh8QvFavHIOnMBirob/7df6gpdPMLnnEFRl4fceYn9GpTr8gTpaWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790982; c=relaxed/simple; bh=5Z3a6EqfMopeFlNjLmJvzuu8xgOP7M/pun/mi8Qn80U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uySpQsIjuF9UDm2OwkVfFSgmlX7OtbBPWMPN1khJbnjbi5YipdUPgEY4EBRa/QUBwLBJWHYOLYA1FTNSGVpjfcJBYg8c3A7S3RVW4gWOwvPVpZHNdn8ZhqlInFjvk792kDDAUQr4APet87RKy0U6aHb42wtpLL8LMRZycVt1qvQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cClXtLWO; 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="cClXtLWO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AFBC1F000FF; Wed, 30 Sep 2026 17:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790790980; bh=OeO9KKDHEFqOtTl6ACtBEWv79f2Y7CQmFmKfAkAWv64=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cClXtLWO2WtkVKbgRODtAJOJcXX6RHpMIyqJzcAxUk9b+zAI5Zt2O6E4o3y+sdl59 inF1ezWo7au3SYfkKKAADVog7Y/4u4mGOsbhlrlXO+jxFu2Nw1mZU7pTpBTWO0BVk3 //EWEPwSgqCoCCoFzoPua8Hhb8Pv4TU2zlkIefLg= 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.15 143/752] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt Date: Wed, 30 Sep 2026 17:20:13 +0200 Message-ID: <20260930152401.272333954@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@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.15-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 7c0b0fe326c22..39fcf0b2efafe 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