Skip to contentSkip to conversation

ASoC: soc-compress: Fix and add missing DPCM locking

PATCH In review Shalini Manjunatha 3 participants 6 messages Mar 6, 2024 – Mar 18, 2024

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

cover ASoC: soc-compress: Fix and add missing DPCM locking

We find mising DPCM locking inside soc_compr_set_params_fe() before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare() in above flow when ever we play compress offload audio playback use case.

To fix this issue added DPCM lock and unlock in both places of above code flow mentioned.

Shalini Manjunatha (1):
ASoC: soc-compress: Fix and add DPCM locking

 sound/soc/soc-compress.c | 4 ++++
 1 file changed, 4 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 ASoC: soc-compress: Fix and add DPCM locking

We find mising DPCM locking inside soc_compr_set_params_fe before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare()

---
 sound/soc/soc-compress.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/soc/soc-compress.c +4 -0
index a38fee4..e692aa3 100644
@@ -385,11 +385,15 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
 
 	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
 
+	snd_soc_dpcm_mutex_lock(fe);
 	ret = dpcm_be_dai_hw_params(fe, stream);
+	snd_soc_dpcm_mutex_unlock(fe);
 	if (ret < 0)
 		goto out;
 
+	snd_soc_dpcm_mutex_lock(fe);
 	ret = dpcm_be_dai_prepare(fe, stream);
+	snd_soc_dpcm_mutex_unlock(fe);
 	if (ret < 0)
 		goto out;
 
Signature · 1 line
2.7.4
maintainer
#2 lore raw
In reply to Shalini Manjunatha
Quoted 8 lines · Shalini Manjunatha

We find mising DPCM locking inside soc_compr_set_params_fe() before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare() in above flow when ever we play compress offload audio playback use case.

To fix this issue added DPCM lock and unlock in both places of above code flow mentioned.

Please don't send cover letters for single patches, if there is anything that needs saying put it in the changelog of the patch or after the --- if it's administrative stuff. This reduces mail volume and ensures that any important information is recorded in the changelog rather than being lost.

maintainer
#3 lore raw
In reply to Shalini Manjunatha
Quoted 5 lines · Shalini Manjunatha

We find mising DPCM locking inside soc_compr_set_params_fe() before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare() in above flow when ever we play compress offload audio playback use case.

where is the patch ?

Quoted 12 lines

To fix this issue added DPCM lock and unlock in both places of above code flow mentioned.

Shalini Manjunatha (1):
ASoC: soc-compress: Fix and add DPCM locking

 sound/soc/soc-compress.c | 4 ++++
 1 file changed, 4 insertions(+)
Signature · 1 line
2.7.4
Signature · 1 line
~Vinod
maintainer
#4 lore raw
Quoted 8 lines · Vinod Koul
Quoted 5 lines · Shalini Manjunatha

We find mising DPCM locking inside soc_compr_set_params_fe() before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare() in above flow when ever we play compress offload audio playback use case.

where is the patch ?

In reply to the cover letter:

https://lore.kernel.org/lkml/d985beeafdd32316eb45f20811eb7926da7a796e.1709720380.git.quic_c_shalma@quicinc.com/

You do seem to be on CC.

maintainer
#5 lore raw
In reply to Shalini Manjunatha
Quoted 10 lines · Shalini Manjunatha

We find mising DPCM locking inside soc_compr_set_params_fe() before calling dpcm_be_dai_hw_params() and dpcm_be_dai_prepare() which cause lockdep assert for DPCM lock not held in __soc_pcm_hw_params() and __soc_pcm_prepare() in above flow when ever we play compress offload audio playback use case.

To fix this issue added DPCM lock and unlock in both places of above code flow mentioned.

[...]

Applied to

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

Thanks!

[1/1] ASoC: soc-compress: Fix and add DPCM locking

      commit: 9a8b202f8cb7ebebc71f1f2a353a21c76d3063a8

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