summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2020-09-01 11:22:05 +0300
committerOded Gabbay <oded.gabbay@gmail.com>2020-09-22 18:49:52 +0300
commit975ab7b32b90c97046ddbdd53798391b7d8a6a1e (patch)
tree41e37b697e15518ce99563f0ca7b499c86af4e1f /drivers/misc
parent0db575350cb1a2fa724f0198fd40b2c91ace5cb7 (diff)
downloadlinux-stable-975ab7b32b90c97046ddbdd53798391b7d8a6a1e.tar.gz
linux-stable-975ab7b32b90c97046ddbdd53798391b7d8a6a1e.tar.bz2
linux-stable-975ab7b32b90c97046ddbdd53798391b7d8a6a1e.zip
habanalabs: count dropped CS because max CS in-flight
There is a case where the user reaches the maximum number of CS in-flight. In that case, the driver rejects the new CS of the user with EAGAIN. Count that event so the user can query the driver later to see if it happened. Reviewed-by: Tomer Tayar <ttayar@habana.ai> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/command_submission.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/command_submission.c b/drivers/misc/habanalabs/common/command_submission.c
index a811a9fdf13b..470bffbe9bdc 100644
--- a/drivers/misc/habanalabs/common/command_submission.c
+++ b/drivers/misc/habanalabs/common/command_submission.c
@@ -252,6 +252,8 @@ static void cs_counters_aggregate(struct hl_device *hdev, struct hl_ctx *ctx)
ctx->cs_counters.parsing_drop_cnt;
hdev->aggregated_cs_counters.queue_full_drop_cnt +=
ctx->cs_counters.queue_full_drop_cnt;
+ hdev->aggregated_cs_counters.max_cs_in_flight_drop_cnt +=
+ ctx->cs_counters.max_cs_in_flight_drop_cnt;
}
static void cs_do_release(struct kref *ref)
@@ -431,8 +433,9 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx,
(hdev->asic_prop.max_pending_cs - 1)];
if (other && !completion_done(&other->completion)) {
- dev_dbg(hdev->dev,
+ dev_dbg_ratelimited(hdev->dev,
"Rejecting CS because of too many in-flights CS\n");
+ ctx->cs_counters.max_cs_in_flight_drop_cnt++;
rc = -EAGAIN;
goto free_fence;
}