提交 698282f6 编写于 作者: V Vaibhav Agarwal 提交者: Greg Kroah-Hartman

greybus: audio: Report DISCONNECT event after resource cleanup.

Reporting DISCONNECT event immediately on module removal causes
race condition while re-populating mixer controls by above HAL. The
original intent was to avoid any (invalid) mixer control modification
request from above layer.

Ideally, it should report 'MODULE_NOT_READY' on module plug-out and
DISCONNECT after resource cleanup. This would involve changes in GB
Audio manager and HAL layer.

Since we already have a plan to remove GB Audio manager, I'm making this
change in GB codec driver to avoid any race condition. Also, codec
driver already ensures mixer control modifcations for disconnected
modules are not triggered to AP Bridge audio FW & reported invalid.
Signed-off-by: NVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: NMark Greer <mgreer@animalcreek.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@google.com>
上级 02f1c12c
...@@ -363,10 +363,12 @@ static void gb_audio_disconnect(struct gb_bundle *bundle) ...@@ -363,10 +363,12 @@ static void gb_audio_disconnect(struct gb_bundle *bundle)
struct gbaudio_data_connection *dai, *_dai; struct gbaudio_data_connection *dai, *_dai;
/* cleanup module related resources first */
gbaudio_unregister_module(gbmodule);
/* inform uevent to above layers */ /* inform uevent to above layers */
gb_audio_manager_remove(gbmodule->manager_id); gb_audio_manager_remove(gbmodule->manager_id);
gbaudio_unregister_module(gbmodule);
gbaudio_tplg_release(gbmodule); gbaudio_tplg_release(gbmodule);
kfree(gbmodule->topology); kfree(gbmodule->topology);
gbmodule->topology = NULL; gbmodule->topology = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册