tegra-alt: adsp: remove broken app deinit code

Existing app deinit code is setting info and other pointers
to NULL, but not calling nvadsp_app_deinit() to close instance
on ADSP. Due to this multiple instances app get created on ADSP
and causing memory leaks.

Current usecases use static paths so app_deinit functionality
is not needed and adds overhead of freeing and allocating apps
everytime. So making tegra210_adsp_app_deinit() a empty function
for now. Proper app deinit functionality will be added in future
if needed.

Bug 200106688

Change-Id: I2b57efa6fa57253ee249c3dc3c43b5843109e2ae
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/744945
(cherry picked from commit ad17bed71e23a978202de7f7a695a4c4cede5dc7)
Reviewed-on: http://git-master/r/747320
This commit is contained in:
Viraj Karandikar
2015-05-20 16:49:39 +05:30
committed by Sameer Pujar
parent 4898d2f0c1
commit c7fd07080a

View File

@@ -591,31 +591,13 @@ err_app_exit:
static void tegra210_adsp_app_deinit(struct tegra210_adsp *adsp,
struct tegra210_adsp_app *app)
{
if (!app || !app->desc)
return;
if (app->info && !IS_APM_OUT(app->reg)) {
app->info = NULL;
app->plugin = NULL;
app->apm = NULL;
if (IS_APM_IN(app->reg)) {
uint32_t apm_out_reg = APM_OUT_START +
(app->reg - APM_IN_START);
struct tegra210_adsp_app *apm_out =
&adsp->apps[apm_out_reg];
nvadsp_mbox_close(&app->rx_mbox);
nvadsp_app_stop(app->info);
apm_out->info = NULL;
apm_out->plugin = NULL;
apm_out->apm = NULL;
} else if (IS_ADMA(app->reg)) {
__clear_bit(app->adma_chan -
TEGRA210_ADSP_ADMA_CHANNEL_START,
adsp->adma_usage);
}
}
/* TODO:
* Current usecases use static paths so app_deinit functionality
* is not needed and adds overhead of freeing and allocating apps
* everytime. Add app deinit functionality properly if needed in
* future.
*/
return;
}
/* API to connect two APMs */