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 <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2857162
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Ayush Kumar <ayushk@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
This commit is contained in:
Arvind M
2023-02-13 06:42:18 +00:00
committed by Laxman Dewangan
parent 5720a7534d
commit 84556afbef

View File

@@ -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);
}