Skip to contentSkip to conversation

accel/amdxdna: Fix incorrect error code returned for failed chain command

PATCH In review Lizhi Hou 3 participants 4 messages Feb 3

Subsystems (2)
lore
Share & tools
lore

Lizhi Hou

author maintainer
#0 lore raw

PATCH 1/1 accel/amdxdna: Fix incorrect error code returned for failed chain command

The driver currently returns an incorrect error code when a chain command fails. In this case, ERT_CMD_STATE_ERROR is expected to be reported for failed chain commands.

Fixes aac243092b70 ("accel/amdxdna: Add command execution")
---
 drivers/accel/amdxdna/aie2_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/amdxdna/aie2_ctx.c +1 -1
index ad5b5cd0bc81..fe8f9783a73c 100644
@@ -274,7 +274,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
 		ret = -EINVAL;
 		goto out;
 	}
-	amdxdna_cmd_set_state(cmd_abo, fail_cmd_status);
+	amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
 
 	if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
 		struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
Signature · 1 line
2.34.1
Reviewed-by Mario Limonciello (AMD) on v1 1/1
#1 lore raw
Quoted 6 lines · Lizhi Hou

The driver currently returns an incorrect error code when a chain command fails. In this case, ERT_CMD_STATE_ERROR is expected to be reported for failed chain commands.

Fixes aac243092b70 ("accel/amdxdna: Add command execution")
Quoted 17 lines
---
  drivers/accel/amdxdna/aie2_ctx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/amdxdna/aie2_ctx.c +1 -1
index ad5b5cd0bc81..fe8f9783a73c 100644
@@ -274,7 +274,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
  		ret = -EINVAL;
  		goto out;
  	}
-	amdxdna_cmd_set_state(cmd_abo, fail_cmd_status);
+	amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
 
  	if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
  		struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Lizhi Hou
Quoted 23 lines · Lizhi Hou

The driver currently returns an incorrect error code when a chain command fails. In this case, ERT_CMD_STATE_ERROR is expected to be reported for failed chain commands.

Fixes aac243092b70 ("accel/amdxdna: Add command execution")
---
  drivers/accel/amdxdna/aie2_ctx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/amdxdna/aie2_ctx.c +1 -1
index ad5b5cd0bc81..fe8f9783a73c 100644
@@ -274,7 +274,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
  		ret = -EINVAL;
  		goto out;
  	}
-	amdxdna_cmd_set_state(cmd_abo, fail_cmd_status);
+	amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
 
  	if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
  		struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
author maintainer Applied
#3 lore raw

Applied to drm-misc-next-fixes.

Quoted 26 lines · Maciej
Quoted 23 lines · Lizhi Hou

The driver currently returns an incorrect error code when a chain command fails. In this case, ERT_CMD_STATE_ERROR is expected to be reported for failed chain commands.

Fixes aac243092b70 ("accel/amdxdna: Add command execution")

---
  drivers/accel/amdxdna/aie2_ctx.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/amdxdna/aie2_ctx.c +1 -1
index ad5b5cd0bc81..fe8f9783a73c 100644
@@ -274,7 +274,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, 
 void __iomem *data, size_t size)
           ret = -EINVAL;
           goto out;
       }
-    amdxdna_cmd_set_state(cmd_abo, fail_cmd_status);
+    amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
         if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
           struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);