summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/common/hw_queue.c
diff options
context:
space:
mode:
authorfarah kassabri <fkassabri@habana.ai>2020-10-12 14:30:26 +0300
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 10:47:31 +0200
commite753643d516c7c38f69f3d73169bb00cd70a60b9 (patch)
treec5b0b56a748cc99e5c5763eb72d9888a7c756160 /drivers/misc/habanalabs/common/hw_queue.c
parent9bb86b63d86493ca10b005e9e49d1d08f998a0ac (diff)
downloadlwn-e753643d516c7c38f69f3d73169bb00cd70a60b9.tar.gz
lwn-e753643d516c7c38f69f3d73169bb00cd70a60b9.zip
habanalabs: fix cs counters structure
Fix cs counters structure in uapi to be one flat structure instead of two instances of the same other structure. use atomic read/increment for context counters so we could use one structure for both aggregated and context counters. Signed-off-by: farah kassabri <fkassabri@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/hw_queue.c')
-rw-r--r--drivers/misc/habanalabs/common/hw_queue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/hw_queue.c b/drivers/misc/habanalabs/common/hw_queue.c
index d9448375beac..44155a6e557f 100644
--- a/drivers/misc/habanalabs/common/hw_queue.c
+++ b/drivers/misc/habanalabs/common/hw_queue.c
@@ -523,7 +523,7 @@ int hl_hw_queue_schedule_cs(struct hl_cs *cs)
hdev->asic_funcs->hw_queues_lock(hdev);
if (hl_device_disabled_or_in_reset(hdev)) {
- ctx->cs_counters.device_in_reset_drop_cnt++;
+ atomic64_inc(&ctx->cs_counters.device_in_reset_drop_cnt);
atomic64_inc(&cntr->device_in_reset_drop_cnt);
dev_err(hdev->dev,
"device is disabled or in reset, CS rejected!\n");
@@ -557,7 +557,8 @@ int hl_hw_queue_schedule_cs(struct hl_cs *cs)
}
if (rc) {
- ctx->cs_counters.queue_full_drop_cnt++;
+ atomic64_inc(
+ &ctx->cs_counters.queue_full_drop_cnt);
atomic64_inc(&cntr->queue_full_drop_cnt);
goto unroll_cq_resv;
}