Hi Ranjani
Thank you for your feedback
Thanks, Morimoto-san. I submitted a solution to fix the deadlock just a couple of days ago as well ( https://mailman.alsa-project.org/pipermail/alsa-devel/2019-June/150764.html ).
I am fine with either solution though.
Hmm... If my understanding was correct, mutex_lock under snd_soc_unbind_card() is not good / not enough. My patch can solve these, but please double check it.
# To be honest, current ALSA SoC is very difficult to read. # Thus, I'm working to cleanup code, actually. I want to post it. # I'm waiting for posted patches to be applied
1) snd_soc_unbind_card() is used from snd_soc_component_del_unlocked() which is used from __snd_soc_unregister_component(). It is using mutex_lock() already
__snd_soc_unregister_component() => mutex_lock() snd_soc_component_del_unlocked() snd_soc_unbind_card() => mutex_lock() soc_remove_link_components() => mutex_unlock() (*2) soc_cleanup_card_resources() => mutex_unlock()
(2) soc_cleanup_card_resources() also calls soc_remove_link_components() (see above (*2))
soc_cleanup_card_resources() soc_remove_dai_links() => soc_remove_link_components()