nvadsp: Handles adspff init failure

- Avoids adspff init in non-secure boot mode
 - Avoids boot failure if adspff.elf is absent
   on secure boot mode

Bug 200773359
Bug 200746669

Change-Id: Ib62ce4ecae3434b7c7fde57e8735620976d2a653
Signed-off-by: Akash Kollipara <akollipara@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2641776
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Akash Kollipara
2021-12-14 16:09:54 +05:30
committed by Laxman Dewangan
parent f5feadcb43
commit 0b2760e995
2 changed files with 20 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2022, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -15,6 +15,7 @@
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/kthread.h>
@@ -653,7 +654,7 @@ int adspff_init(struct platform_device *pdev)
handle = nvadsp_app_load("adspff", "adspff.elf");
if (!handle)
return -1;
return -ENOENT;
app_info = nvadsp_app_init(handle, NULL);
if (!app_info) {

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2011 Texas Instruments, Inc.
* Copyright (C) 2011 Google, Inc.
*
* Copyright (C) 2014-2021, NVIDIA Corporation. All rights reserved.
* Copyright (C) 2014-2022, NVIDIA Corporation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/iommu.h>
@@ -1815,19 +1816,23 @@ int nvadsp_os_start(void)
priv.os_running = drv_data->adsp_os_running = true;
priv.num_start++;
#if defined(CONFIG_TEGRA_ADSP_FILEIO)
if (!drv_data->adspff_init) {
ret = adspff_init(priv.pdev);
if (ret) {
priv.os_running = drv_data->adsp_os_running = false;
dev_err(dev,
"adsp boot failed at adspff init with ret = %d",
ret);
dump_adsp_sys();
free_interrupts(&priv);
if ((drv_data->adsp_os_secload) && (!drv_data->adspff_init)) {
int adspff_status = adspff_init(priv.pdev);
if (adspff_status) {
if (adspff_status != -ENOENT) {
priv.os_running = drv_data->adsp_os_running = false;
dev_err(dev,
"adsp boot failed at adspff init with ret = %d",
adspff_status);
dump_adsp_sys();
free_interrupts(&priv);
#ifdef CONFIG_PM
pm_runtime_put_sync(&priv.pdev->dev);
pm_runtime_put_sync(&priv.pdev->dev);
#endif
goto unlock;
ret = adspff_status;
goto unlock;
}
} else
drv_data->adspff_init = true;
}