summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2020-07-28 00:28:51 +0300
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 10:47:32 +0200
commit4ba1b227b6c77252f49f96aa77cf1b50b9d2542c (patch)
tree46f017b058dee031684e7fc6d801068e7f1942c0
parentea6ee260cbcdd1e00d8eb62057d432dddd2a71d1 (diff)
downloadlinux-4ba1b227b6c77252f49f96aa77cf1b50b9d2542c.tar.bz2
habanalabs: Skip updating CI of internal queues if not in use
There are no internal queues if H/W queues are being used. In this case we can skip the redundant traversal over the queues array, looking for internal queues. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
-rw-r--r--drivers/misc/habanalabs/common/hw_queue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/hw_queue.c b/drivers/misc/habanalabs/common/hw_queue.c
index 44155a6e557f..e808e668a007 100644
--- a/drivers/misc/habanalabs/common/hw_queue.c
+++ b/drivers/misc/habanalabs/common/hw_queue.c
@@ -48,6 +48,11 @@ void hl_int_hw_queue_update_ci(struct hl_cs *cs)
return;
q = &hdev->kernel_queues[0];
+
+ /* There are no internal queues if H/W queues are being used */
+ if (!hdev->asic_prop.max_queues || q->queue_type == QUEUE_TYPE_HW)
+ return;
+
for (i = 0 ; i < hdev->asic_prop.max_queues ; i++, q++) {
if (q->queue_type == QUEUE_TYPE_INT)
atomic_add(cs->jobs_in_queue_cnt[i], &q->ci);