Skip to contentSkip to conversation

habanalabs: add debug print when rejecting CS

PATCH In review Oded Gabbay 2 participants 2 messages Jul 18, 2019 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: add debug print when rejecting CS

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)

---
 drivers/misc/habanalabs/command_submission.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/misc/habanalabs/command_submission.c +2 -0
index 6ad83d5ef4b0..f4e2c2ad0057 100644
@@ -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;
 	}
Signature · 1 line
2.17.1