Skip to contentSkip to conversation

ASoC: rockchip: rockchip_sai: Handle runtime PM resume failures in set_fmt

PATCH In review [email protected] 2 participants 3 messages Sep 3 – Oct 8

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: rockchip: rockchip_sai: Handle runtime PM resume failures in set_fmt

From: bui duc phuc <[email protected]>

rockchip_sai_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.

Fixes cc78d1eaabad ("ASoC: rockchip: add Serial Audio Interface (SAI) driver")
---
 sound/soc/rockchip/rockchip_sai.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/rockchip/rockchip_sai.c +3 -1
index 30b5e71d0937..264a99e618a5 100644
@@ -487,7 +487,9 @@ static int rockchip_sai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	unsigned long flags;
 	int ret = 0;
 
-	pm_runtime_get_sync(dai->dev);
+	ret = pm_runtime_resume_and_get(dai->dev);
+	if (ret)
+		return ret;
 
 	mask = SAI_CKR_MSS_MASK;
 	switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt

From: bui duc phuc <[email protected]>

rockchip_i2s_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.

Fixes 53ca9b9777b9 ("ASoC: rockchip: i2s: Fix regmap_ops hang")
---
 sound/soc/rockchip/rockchip_i2s.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/rockchip/rockchip_i2s.c +3 -1
index 261f36d4c2fd..e7ea71783e37 100644
@@ -244,7 +244,9 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
 	unsigned int mask = 0, val = 0;
 	int ret = 0;
 
-	pm_runtime_get_sync(cpu_dai->dev);
+	ret = pm_runtime_resume_and_get(cpu_dai->dev);
+	if (ret)
+		return ret;
 	mask = I2S_CKR_MSS_MASK;
 	switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
 	case SND_SOC_DAIFMT_BP_FP:
Signature · 1 line
2.43.0
maintainer
#2 lore raw
In reply to [email protected]
Quoted 1 line · On Thu, 03 Sep 2026 18:27:38 +0700, [email protected] wrote:

ASoC: rockchip: rockchip_sai: Handle runtime PM resume failures in set_fmt

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/2] ASoC: rockchip: rockchip_sai: Handle runtime PM resume failures in set_fmt

      https://git.kernel.org/broonie/sound/c/39205bb7ed4f
[2/2] ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt
      https://git.kernel.org/broonie/sound/c/e9eb1854d161

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark