ASoC: rockchip: rockchip_sai: Handle runtime PM resume failures in set_fmt
Subsystems (4)
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.
--- sound/soc/rockchip/rockchip_sai.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/rockchip/rockchip_sai.c +3 -1
@@ -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
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.
--- sound/soc/rockchip/rockchip_i2s.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/rockchip/rockchip_i2s.c +3 -1
@@ -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
Mark Brown
maintainerQuoted 1 line · On Thu, 03 Sep 2026 18:27:38 +0700, [email protected] wrote:
ASoC: rockchip:
rockchip_sai: Handle runtime PM resume failures inset_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