habanalabs: add debug print when rejecting CS
authorOded Gabbay <oded.gabbay@gmail.com>
Thu, 18 Jul 2019 06:03:58 +0000 (09:03 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 5 Sep 2019 11:55:26 +0000 (14:55 +0300)
When rejecting CS because of too many in-flight CS, print a debug message
about it as it useful to know when the user is debugging (it indicates a
back-pressure from the driver as the device is not fast enough to consume
the CS)

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
drivers/misc/habanalabs/command_submission.c

index f00d1c3..e4dd3e8 100644 (file)
@@ -305,6 +305,8 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx,
        other = ctx->cs_pending[fence->cs_seq & (HL_MAX_PENDING_CS - 1)];
        if ((other) && (!dma_fence_is_signaled(other))) {
                spin_unlock(&ctx->cs_lock);
+               dev_dbg(hdev->dev,
+                       "Rejecting CS because of too many in-flights CS\n");
                rc = -EAGAIN;
                goto free_fence;
        }