Skip to contentSkip to conversation

lib/amdgpu: add oversized invalid packet length error handling

PATCH In review Jesse Zhang 3 participants 4 messages Apr 8 – Apr 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/amdgpu: add oversized invalid packet length error handling

Add a dedicated cmd error type for oversized packet length and handle it in gfx_ring_bad_write_linear().

- add CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE to cmd_error_type
- in gfx_ring_bad_write_linear(), map this error to:
stream_length = ring_context->write_length * 2
- keep existing invalid-short-length path unchanged

---
 lib/amdgpu/amd_ip_blocks.c | 2 ++
 lib/amdgpu/amd_ip_blocks.h | 1 +
 2 files changed, 3 insertions(+)
lib/amdgpu/amd_ip_blocks.c +2 -0
index f0376a3e7..80aa5569c 100644
@@ -284,6 +284,8 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	  */
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
 		stream_length = ring_context->write_length / 16;
+	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE)
+		stream_length = ring_context->write_length * 2;
 	else
 		stream_length = ring_context->write_length;
 
lib/amdgpu/amd_ip_blocks.h +1 -0
index 6bc8c3706..eb118c68a 100644
@@ -146,6 +146,7 @@ enum  cmd_error_type {
 	CMD_STREAM_EXEC_SUCCESS,
 	CMD_STREAM_EXEC_INVALID_OPCODE,
 	CMD_STREAM_EXEC_INVALID_PACKET_LENGTH,
+	CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE,
 	CMD_STREAM_EXEC_INVALID_PACKET_EOP_QUEUE,
 	CMD_STREAM_TRANS_BAD_REG_ADDRESS,
 	CMD_STREAM_TRANS_BAD_MEM_ADDRESS,
Signature · 1 line
2.49.0
#1 lore raw

PATCH 2/2 tests/amdgpu: add string mapping for oversized packet length error

Extend queue-reset error string table with the new CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE enum.

---
 tests/amdgpu/amd_queue_reset.c | 1 +
 1 file changed, 1 insertion(+)
tests/amdgpu/amd_queue_reset.c +1 -0
index 7cd2ff79a..73a99bb89 100644
@@ -264,6 +264,7 @@ is_dispatch_shader_test(unsigned int err, char error_str[128], bool *is_dispatch
 		{ CMD_STREAM_EXEC_SUCCESS,                   false, "CMD_STREAM_EXEC_SUCCESS" },
 		{ CMD_STREAM_EXEC_INVALID_OPCODE,            false, "CMD_STREAM_EXEC_INVALID_OPCODE" },
 		{ CMD_STREAM_EXEC_INVALID_PACKET_LENGTH,     false, "CMD_STREAM_EXEC_INVALID_PACKET_LENGTH" },
+		{ CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE, false, "CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE" },
 		{ CMD_STREAM_EXEC_INVALID_PACKET_EOP_QUEUE,  false, "CMD_STREAM_EXEC_INVALID_PACKET_EOP_QUEUE" },
 		{ CMD_STREAM_TRANS_BAD_REG_ADDRESS,          false, "CMD_STREAM_TRANS_BAD_REG_ADDRESS" },
 		{ CMD_STREAM_TRANS_BAD_MEM_ADDRESS,          false, "CMD_STREAM_TRANS_BAD_MEM_ADDRESS" },
Signature · 1 line
2.49.0
Reviewed-by on v1 1/2
#2 lore raw
In reply to Jesse Zhang

LGTM both patches

Quoted 39 lines · Jesse Zhang

Add a dedicated cmd error type for oversized packet length and handle it in gfx_ring_bad_write_linear().

- add CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE to cmd_error_type
- in gfx_ring_bad_write_linear(), map this error to:
stream_length = ring_context->write_length * 2
- keep existing invalid-short-length path unchanged

---
 lib/amdgpu/amd_ip_blocks.c | 2 ++
 lib/amdgpu/amd_ip_blocks.h | 1 +
 2 files changed, 3 insertions(+)
lib/amdgpu/amd_ip_blocks.c +2 -0
index f0376a3e7..80aa5569c 100644
@@ -284,6 +284,8 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	  */
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
 		stream_length = ring_context->write_length / 16;
+	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE)
+		stream_length = ring_context->write_length * 2;
 	else
 		stream_length = ring_context->write_length;
 
lib/amdgpu/amd_ip_blocks.h +1 -0
index 6bc8c3706..eb118c68a 100644
@@ -146,6 +146,7 @@ enum  cmd_error_type {
 	CMD_STREAM_EXEC_SUCCESS,
 	CMD_STREAM_EXEC_INVALID_OPCODE,
 	CMD_STREAM_EXEC_INVALID_PACKET_LENGTH,
+	CMD_STREAM_EXEC_INVALID_PACKET_LENGTH_OVERSIZE,
 	CMD_STREAM_EXEC_INVALID_PACKET_EOP_QUEUE,
 	CMD_STREAM_TRANS_BAD_REG_ADDRESS,
 	CMD_STREAM_TRANS_BAD_MEM_ADDRESS,
#3 lore raw

✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] lib/amdgpu: add oversized invalid packet length error handling

In reply to Jesse Zhang
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/amdgpu: add oversized invalid packet length error handling
URL : https://patchwork.freedesktop.org/series/164484/
State : failure

== Summary ==

Series 164484 revision 1 was fully merged or fully failed: no git log