Commit 0eab4f89 authored by Oded Gabbay's avatar Oded Gabbay

habanalabs: rephrase error messages

rephrase some error/warning/notice messages to make them more accessible to
ordinary users.

There is no need to print context ASID as the driver currently doesn't
support multiple contexts.
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: default avatarTomer Tayar <ttayar@habana.ai>
parent dd9efabd
...@@ -373,9 +373,9 @@ static void cs_timedout(struct work_struct *work) ...@@ -373,9 +373,9 @@ static void cs_timedout(struct work_struct *work)
hdev = cs->ctx->hdev; hdev = cs->ctx->hdev;
ctx_asid = cs->ctx->asid; ctx_asid = cs->ctx->asid;
/* TODO: add information about last signaled seq and last emitted seq */ dev_err(hdev->dev,
dev_err(hdev->dev, "User %d command submission %llu got stuck!\n", "Command submission %llu has not finished in time!\n",
ctx_asid, cs->sequence); cs->sequence);
cs_put(cs); cs_put(cs);
...@@ -1130,7 +1130,7 @@ static long _hl_cs_wait_ioctl(struct hl_device *hdev, ...@@ -1130,7 +1130,7 @@ static long _hl_cs_wait_ioctl(struct hl_device *hdev,
rc = PTR_ERR(fence); rc = PTR_ERR(fence);
if (rc == -EINVAL) if (rc == -EINVAL)
dev_notice_ratelimited(hdev->dev, dev_notice_ratelimited(hdev->dev,
"Can't wait on seq %llu because current CS is at seq %llu\n", "Can't wait on CS %llu because current CS is at seq %llu\n",
seq, ctx->cs_sequence); seq, ctx->cs_sequence);
} else if (fence) { } else if (fence) {
rc = dma_fence_wait_timeout(fence, true, timeout); rc = dma_fence_wait_timeout(fence, true, timeout);
...@@ -1163,15 +1163,21 @@ int hl_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data) ...@@ -1163,15 +1163,21 @@ int hl_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
memset(args, 0, sizeof(*args)); memset(args, 0, sizeof(*args));
if (rc < 0) { if (rc < 0) {
dev_err_ratelimited(hdev->dev,
"Error %ld on waiting for CS handle %llu\n",
rc, seq);
if (rc == -ERESTARTSYS) { if (rc == -ERESTARTSYS) {
dev_err_ratelimited(hdev->dev,
"user process got signal while waiting for CS handle %llu\n",
seq);
args->out.status = HL_WAIT_CS_STATUS_INTERRUPTED; args->out.status = HL_WAIT_CS_STATUS_INTERRUPTED;
rc = -EINTR; rc = -EINTR;
} else if (rc == -ETIMEDOUT) { } else if (rc == -ETIMEDOUT) {
dev_err_ratelimited(hdev->dev,
"CS %llu has timed-out while user process is waiting for it\n",
seq);
args->out.status = HL_WAIT_CS_STATUS_TIMEDOUT; args->out.status = HL_WAIT_CS_STATUS_TIMEDOUT;
} else if (rc == -EIO) { } else if (rc == -EIO) {
dev_err_ratelimited(hdev->dev,
"CS %llu has been aborted while user process is waiting for it\n",
seq);
args->out.status = HL_WAIT_CS_STATUS_ABORTED; args->out.status = HL_WAIT_CS_STATUS_ABORTED;
} }
return rc; return rc;
......
...@@ -112,8 +112,7 @@ void hl_ctx_free(struct hl_device *hdev, struct hl_ctx *ctx) ...@@ -112,8 +112,7 @@ void hl_ctx_free(struct hl_device *hdev, struct hl_ctx *ctx)
return; return;
dev_warn(hdev->dev, dev_warn(hdev->dev,
"Context %d closed or terminated but its CS are executing\n", "user process released device but its command submissions are still executing\n");
ctx->asid);
} }
int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx) int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx)
......
...@@ -289,7 +289,7 @@ int hl_fw_armcp_info_get(struct hl_device *hdev) ...@@ -289,7 +289,7 @@ int hl_fw_armcp_info_get(struct hl_device *hdev)
HL_ARMCP_INFO_TIMEOUT_USEC, &result); HL_ARMCP_INFO_TIMEOUT_USEC, &result);
if (rc) { if (rc) {
dev_err(hdev->dev, dev_err(hdev->dev,
"Failed to send ArmCP info pkt, error %d\n", rc); "Failed to handle ArmCP info pkt, error %d\n", rc);
goto out; goto out;
} }
...@@ -340,7 +340,7 @@ int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size) ...@@ -340,7 +340,7 @@ int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size)
if (rc) { if (rc) {
dev_err(hdev->dev, dev_err(hdev->dev,
"Failed to send ArmCP EEPROM packet, error %d\n", rc); "Failed to handle ArmCP EEPROM packet, error %d\n", rc);
goto out; goto out;
} }
......
...@@ -1730,8 +1730,7 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx) ...@@ -1730,8 +1730,7 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
*/ */
if (!hdev->hard_reset_pending && !hash_empty(ctx->mem_hash)) if (!hdev->hard_reset_pending && !hash_empty(ctx->mem_hash))
dev_notice(hdev->dev, dev_notice(hdev->dev,
"ctx %d is freed while it has va in use\n", "user released device without removing its memory mappings\n");
ctx->asid);
hash_for_each_safe(ctx->mem_hash, i, tmp_node, hnode, node) { hash_for_each_safe(ctx->mem_hash, i, tmp_node, hnode, node) {
dev_dbg(hdev->dev, dev_dbg(hdev->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment