Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/amdgpu: update bad length case
@ 2024-08-01 10:59 Prike Liang
  2024-08-01 13:58 ` ✓ CI.xeBAT: success for tests/amdgpu: update bad length case (rev3) Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Prike Liang @ 2024-08-01 10:59 UTC (permalink / raw)
  To: igt-dev; +Cc: Vitaly.Prosyak, Jesse.Zhang, Alexander.Deucher, Prike Liang

In the bad length case, when the header length has more than 4dwords than
packet stream length then CPFW will pending on the stream data and raise a
CP halt error which requires do the pipe reset. As to the orignal case
of header length is smaller than PM4 stream length then the PM4 stream
data may will create a bad opcode error which only requires the queue
reset. So for testing the pipe reset need to update the header length
bigger than the PM4 stream data length.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index f675b97dd..3ffacc065 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -189,7 +189,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 		      const struct amdgpu_ring_context *ring_context,
 		      uint32_t *pm4_dw, unsigned int cmd_error)
 {
-	uint32_t i, j;
+	uint32_t i, j, stream_length;
 
 	i = 0;
 	j = 0;
@@ -198,6 +198,11 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	  * But the range applies to all asics.
 	  * 0xcb-0xcf, 0xd2-0xef, 0xf1-0xfb
 	  */
+	if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
+		stream_length = ring_context->write_length / 16;
+	else
+		stream_length = ring_context->write_length;
+
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_OPCODE)
 		ring_context->pm4[i++] = PACKET3(0xf2, 2 +  ring_context->write_length);
 	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
@@ -223,7 +228,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 		ring_context->pm4[i++] = upper_32_bits(ring_context->bo_mc);
 	}
 
-	while (j++ < ring_context->write_length)
+	while (j++ < stream_length)
 		ring_context->pm4[i++] = func->deadbeaf;
 	*pm4_dw = i;
 	return i;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH] tests/amdgpu: update bad length case
@ 2024-08-01  9:55 Prike Liang
  2024-08-01 10:33 ` Zhang, Jesse(Jie)
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Prike Liang @ 2024-08-01  9:55 UTC (permalink / raw)
  To: igt-dev; +Cc: Vitaly.Prosyak, Jesse.Zhang, Alexander.Deucher, Prike Liang

In the bad length case, when the header length has more than 4dwords than
packet stream length then CPFW will pending on the stream data and raise a
CP halt error which requires do the pipe reset. As to the orignal case
of header length is smaller than PM4 stream length then the PM4 stream
data may will create a bad opcode error which only requires the queue
reset. So for testing the pipe reset need to update the header length
bigger than the PM4 stream data length.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index f675b97dd..503b68431 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -189,7 +189,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 		      const struct amdgpu_ring_context *ring_context,
 		      uint32_t *pm4_dw, unsigned int cmd_error)
 {
-	uint32_t i, j;
+	uint32_t i, j, stream_length;
 
 	i = 0;
 	j = 0;
@@ -198,6 +198,11 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	  * But the range applies to all asics.
 	  * 0xcb-0xcf, 0xd2-0xef, 0xf1-0xfb
 	  */
+	if (cmd_error == CMD_STREAM_EXEC_INVALID_OPCODE)
+		stream_length = ring_context->write_length / 16;
+	else
+		stream_length = ring_context->write_length;
+
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_OPCODE)
 		ring_context->pm4[i++] = PACKET3(0xf2, 2 +  ring_context->write_length);
 	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
@@ -223,7 +228,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 		ring_context->pm4[i++] = upper_32_bits(ring_context->bo_mc);
 	}
 
-	while (j++ < ring_context->write_length)
+	while (j++ < stream_length)
 		ring_context->pm4[i++] = func->deadbeaf;
 	*pm4_dw = i;
 	return i;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH] tests/amdgpu: update bad length case
@ 2024-08-01  8:25 Prike Liang
  2024-08-01  8:29 ` Zhang, Jesse(Jie)
  0 siblings, 1 reply; 15+ messages in thread
From: Prike Liang @ 2024-08-01  8:25 UTC (permalink / raw)
  To: igt-dev; +Cc: Vitaly.Prosyak, Alexander.Deucher, Prike Liang

In the bad length case, when the header length is bigger than packet
stream length then CPFW will pending on the stream data and raise a
CP halt error which requires do the pipe reset. As to the orignal case
of header length is smaller than PM4 stream length then the PM4 stream
data may will create a bad opcode error which only requires the queue
reset. So for testing the pipe reset need to update the header length
bigger than the PM4 stream data length.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index f675b97dd..edfd16e76 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -201,7 +201,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_OPCODE)
 		ring_context->pm4[i++] = PACKET3(0xf2, 2 +  ring_context->write_length);
 	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
-		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, (ring_context->write_length - 2));
+		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, (ring_context->write_length + 4));
 	else
 		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, 2 +  ring_context->write_length);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-08-07  1:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 10:59 [PATCH] tests/amdgpu: update bad length case Prike Liang
2024-08-01 13:58 ` ✓ CI.xeBAT: success for tests/amdgpu: update bad length case (rev3) Patchwork
2024-08-01 14:13 ` ✓ Fi.CI.BAT: " Patchwork
2024-08-01 15:34 ` ✗ CI.xeFULL: failure " Patchwork
2024-08-02  7:27 ` ✗ Fi.CI.IGT: " Patchwork
2024-08-07  1:06 ` [PATCH] tests/amdgpu: update bad length case Liang, Prike
2024-08-07  1:16   ` vitaly prosyak
  -- strict thread matches above, loose matches on Subject: below --
2024-08-01  9:55 Prike Liang
2024-08-01 10:33 ` Zhang, Jesse(Jie)
2024-08-01 10:47 ` Zhang, Jesse(Jie)
2024-08-01 10:56   ` Liang, Prike
2024-08-01 10:59 ` Zhang, Jesse(Jie)
2024-08-01  8:25 Prike Liang
2024-08-01  8:29 ` Zhang, Jesse(Jie)
2024-08-01  9:51   ` Liang, Prike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox