[PATCH] ASoC: soc-pcm: Revert "call snd_soc_component_open/close() once"

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Mar 4 01:11:48 CET 2020


Hi Kai

Thank you for your feedback

> > close() will be called 1) when open failed, or, 2) normal close.
> > If my understanding was correct, your code is caring that
> > 2) normal close() might be called without open().
> 
> it also covers case (1) when open fails. So instead of the currently 
> merged error case rollback code in soc_pcm_components_open(), we'd just 
> call snd_pcm_components_close(substream) directly in case 
> of error. With tracking of opened substreams in soc-component.c, close() 
> is safe to call also in error case.

Oh, yes, of course.
I'm sorry to you for my lack of words.
My question was
"My idea cares open-close mismatch only for 1).
and your's cared both 1) and 2) ?", I mean.

> That considered, I'm fine if you can come up with a cleaner version to 
> handle just case (1), without tracking substreams. Maybe worth a try and 
> if it doesn't work (e.g. with ID/tag), we can look at substream tracking.

I see.
Let's use step-by-step approach.
I will try to care 1) as 1st step.
If it was not enough, or, if we want to have tracker,
let's update it by your idea as 2nd step.

Thank you for your help !!

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list