From 84556afbef27d4968f1ef5254e00d6f4975df3d5 Mon Sep 17 00:00:00 2001 From: Arvind M Date: Mon, 13 Feb 2023 06:42:18 +0000 Subject: [PATCH] nvdla: kmd: put pm reference with task completion. [1] With the current design, the DLA is leaning on the nvhost callback notifier for putting the pm reference. [2] This commit decouples that dependency by putting the pm reference for every task completion. Jira DLA-6649 Jira LS-477 Change-Id: I84ea948b7f717f7f3e28ac1f58f17f07c53e822b Signed-off-by: Arvind M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2857162 Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: svc_kernel_abi Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Ayush Kumar Reviewed-by: Ken Adams GVS: Gerrit_Virtual_Submit Tested-by: Amit Sharma (SW-TEGRA) --- drivers/video/tegra/host/nvdla/nvdla_queue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla_queue.c b/drivers/video/tegra/host/nvdla/nvdla_queue.c index 3648d7e7..e297fce1 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_queue.c +++ b/drivers/video/tegra/host/nvdla/nvdla_queue.c @@ -1,7 +1,7 @@ /* * NVDLA queue and task management for T194 * - * Copyright (c) 2016-2022, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2016-2023, 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, @@ -322,7 +322,7 @@ static inline size_t nvdla_profile_status_offset(struct nvdla_task *task) return offset; } -static void nvdla_queue_update(void *priv, int nr_completed) +static void nvdla_queue_update(void *priv, int unused) { int task_complete; struct nvdla_task *task, *safe; @@ -331,6 +331,7 @@ static void nvdla_queue_update(void *priv, int nr_completed) struct nvhost_notification *tsp_notifier; u64 timestamp_start, timestamp_end; u64 *timestamp_ptr; + int n_tasks_completed = 0; mutex_lock(&queue->list_lock); @@ -371,10 +372,12 @@ static void nvdla_queue_update(void *priv, int nr_completed) timestamp_end); nvdla_task_free_locked(task); + n_tasks_completed++; } } + /* put pm refcount */ - nvhost_module_idle_mult(pdev, nr_completed); + nvhost_module_idle_mult(pdev, n_tasks_completed); mutex_unlock(&queue->list_lock); }