[PATCH][RFC] ASoC: soc-component: count snd_soc_component_open/close()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Feb 20 04:01:13 CET 2020


Hi Sridharan

>     >     ASoC component open/close and snd_soc_component_module_get/put are
>     >     called once for each component, but we need it for each substream.
>     >     To solve this issue, this patch counts open / get,
>     >     and call close / put accordingly.
>     >
>     >     Fixes: dd03907bf129 ("ASoC: soc-pcm: call snd_soc_component_open/close() once")
>     >     Reported-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>
>     >     Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
>     >     ---
(snip)
>     I think same as open ?
>     It protects calling put() from not-get-component.
>     Because module_put() has WARN_ON(ret < 0).
> 
> Can we use the module_refcount instead of adding a new field?

Ahh, maybe yes.
I can try to use it in non-RFC patch.

Thank you for your help !!
Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list