From 0b3f6dae2bad21b575bd93489500e4b7928d6577 Mon Sep 17 00:00:00 2001 From: Viraj Karandikar Date: Tue, 28 Apr 2015 16:19:43 +0530 Subject: [PATCH] tegra-alt: adsp: ignore app load failure during init Error in app loading skips loading of other apps and disables further use of ADSP. This prevents use of other successfully loaded apps which could have worked fine. Avoid skipping of remaining apps when loading fails for one app. Failed app will anyway throw error whenever user attempts to use it. This also allows adding entries for optional apps. Check if app was loaded when calling app_init(). Bug 200100724 Change-Id: I70a818df6fdeb54f94700e6c5f10a1dd1b269b72 Signed-off-by: Viraj Karandikar Reviewed-on: http://git-master/r/736736 (cherry picked from commit 5387c9989420525b6ce7eaafd2ddb913f496740d) Reviewed-on: http://git-master/r/740608 Reviewed-on: http://git-master/r/750726 Tested-by: Ravindra Lokhande Reviewed-by: Sumit Bhattacharya Reviewed-by: Arun Shamanna Lakshmi --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index 4098cb42..24c6afff 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -316,8 +316,6 @@ static int tegra210_adsp_init(struct tegra210_adsp *adsp) if (!adsp_app_desc[i].handle) { dev_err(adsp->dev, "Failed to load app %s", adsp_app_desc[i].name); - nvadsp_os_stop(); - goto exit; } } @@ -533,6 +531,10 @@ static int tegra210_adsp_app_init(struct tegra210_adsp *adsp, if (app->info || IS_APM_OUT(app->reg)) return 0; + if (!app->desc->handle) { + return -ENODEV; + } + app->info = nvadsp_app_init(app->desc->handle, NULL); if (!app->info) { dev_err(adsp->dev, "Failed to init app %s(%s).", @@ -1685,7 +1687,8 @@ static int tegra210_adsp_mux_put(struct snd_kcontrol *kcontrol, } else { ret = tegra210_adsp_app_init(adsp, app); if (ret < 0) { - dev_err(adsp->dev, "Failed to init app."); + dev_err(adsp->dev, "Failed to init app %s(%s)", + app->desc->name, app->desc->fw_name); goto err_put; } }