mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
nvadsp: app: Dispatch apps on sec-cores
- Updated nvadsp_run_app to accept core ID for pinning app - For legacy api, apps are pinned to core 0 Bug 3664974 Signed-off-by: Akash Kollipara <akollipara@nvidia.com> Change-Id: I8f3bcc6a77bb2f912675cfd5af131cdbd36c417c Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738421 (cherry picked from commit 12bcba564e9a570218eab944d4ee8e64074c6be4) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2747911 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Viswanath L <viswanathl@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
3a6d714aa7
commit
358498746a
@@ -224,13 +224,15 @@ adsp_consol_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
||||
ret = -EACCES;
|
||||
break;
|
||||
}
|
||||
|
||||
dev_info(dev, "Core ID: %d\n", app_args.core_id);
|
||||
app_args.app_name[NVADSP_NAME_SZ_MAX] = '\0';
|
||||
|
||||
#ifdef USE_RUN_APP_API
|
||||
app_args.ctx2 = (uint64_t)nvadsp_run_app(NULL,
|
||||
app_args.app_name,
|
||||
(nvadsp_app_args_t *)&app_args.args[0],
|
||||
NULL, 0, true);
|
||||
NULL, 0, app_args.core_id, true);
|
||||
if (!app_args.ctx2) {
|
||||
dev_info(dev, "adsp_consol: unable to run %s\n",
|
||||
app_args.app_name);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* A header file containing shared data structures shared with ADSP OS
|
||||
*
|
||||
* Copyright (C) 2015-2021 NVIDIA Corporation. All rights reserved.
|
||||
* Copyright (C) 2015-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
|
||||
@@ -64,6 +64,7 @@ struct run_app_instance_data {
|
||||
struct app_mem_size mem_size;
|
||||
nvadsp_app_args_t app_args;
|
||||
uint32_t stack_size;
|
||||
uint32_t core_id;
|
||||
uint32_t message;
|
||||
} __packed;
|
||||
|
||||
|
||||
@@ -548,7 +548,8 @@ static void fill_app_instance_data(nvadsp_app_info_t *app,
|
||||
|
||||
static nvadsp_app_info_t *create_app_instance(nvadsp_app_handle_t handle,
|
||||
nvadsp_app_args_t *app_args, struct run_app_instance_data *data,
|
||||
app_complete_status_notifier notifier, uint32_t stack_size)
|
||||
app_complete_status_notifier notifier, uint32_t stack_size,
|
||||
uint32_t core_id)
|
||||
{
|
||||
struct nvadsp_app_service *ser = (void *)handle;
|
||||
struct device *dev = &priv.pdev->dev;
|
||||
@@ -581,6 +582,8 @@ static nvadsp_app_info_t *create_app_instance(nvadsp_app_handle_t handle,
|
||||
|
||||
/* assign the stack that is needed by the app */
|
||||
data->stack_size = stack_size;
|
||||
/* assign the core that is needed by the app */
|
||||
data->core_id = core_id;
|
||||
|
||||
/* set the state to INITIALIZED. No need to do it in a spin lock */
|
||||
state = (int *)&app->state;
|
||||
@@ -652,7 +655,8 @@ nvadsp_app_info_t __must_check *nvadsp_app_init(nvadsp_app_handle_t handle,
|
||||
msgq_send = &msg_pool->app_loader_send_message.msgq;
|
||||
data = &message->data;
|
||||
|
||||
app = create_app_instance(handle, args, &data->app_init, NULL, 0);
|
||||
/* Pinning app to core 0 by default */
|
||||
app = create_app_instance(handle, args, &data->app_init, NULL, 0, 0);
|
||||
if (IS_ERR_OR_NULL(app)) {
|
||||
pr_err("Failed to create APP instance\n");
|
||||
kfree(message);
|
||||
@@ -758,7 +762,8 @@ EXPORT_SYMBOL(nvadsp_app_start);
|
||||
|
||||
nvadsp_app_info_t *nvadsp_run_app(nvadsp_os_handle_t os_handle,
|
||||
const char *appfile, nvadsp_app_args_t *app_args,
|
||||
app_complete_status_notifier notifier, uint32_t stack_sz, bool block)
|
||||
app_complete_status_notifier notifier, uint32_t stack_sz,
|
||||
uint32_t core_id, bool block)
|
||||
{
|
||||
union app_loader_message message = {};
|
||||
nvadsp_app_handle_t service_handle;
|
||||
@@ -791,7 +796,7 @@ nvadsp_app_info_t *nvadsp_run_app(nvadsp_os_handle_t os_handle,
|
||||
}
|
||||
|
||||
info = create_app_instance(service_handle, app_args,
|
||||
&data->app_init, notifier, stack_sz);
|
||||
&data->app_init, notifier, stack_sz, core_id);
|
||||
if (IS_ERR_OR_NULL(info)) {
|
||||
dev_err(dev, "unable to create instance for app %s\n", appfile);
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user