[PATCH UMR] Fix off-by-one error for decoding sdma linear write packet
Xiaojie Yuan
xiaojie.yuan at amd.com
Tue Jul 14 04:18:30 UTC 2020
COUNT in linear write packet represents dword number - 1
Before fix:
navi10.sdma0.ring[ 0] == 0x00000002 .w. OPCODE: [WRITE], SUB-OPCODE: [0], LINEAR_WRITE
navi10.sdma0.ring[ 1] == 0x00400a60 ... |---+ WORD [1]: DST_ADDR_LO: 0x00400a60
navi10.sdma0.ring[ 2] == 0x00000000 ... |---+ WORD [2]: DST_ADDR_HI: 0x00000000
navi10.sdma0.ring[ 3] == 0x00000000 ... |---+ WORD [3]: COUNT: 0x00000000
navi10.sdma0.ring[ 4] == 0xdeadbeef ...
After fix:
navi10.sdma0.ring[ 0] == 0x00000002 .w. OPCODE: [WRITE], SUB-OPCODE: [0], LINEAR_WRITE
navi10.sdma0.ring[ 1] == 0x00400a60 ... |---+ WORD [1]: DST_ADDR_LOa: 0x00400a60
navi10.sdma0.ring[ 2] == 0x00000000 ... |---+ WORD [2]: DST_ADDR_HIb: 0x00000000
navi10.sdma0.ring[ 3] == 0x00000000 ... |---+ WORD [3]: COUNTc: 0x00000000
navi10.sdma0.ring[ 4] == 0xdeadbeef ... \---+ WORD [4]: DATA: 0xdeadbeef
Signed-off-by: Xiaojie Yuan <xiaojie.yuan at amd.com>
---
src/lib/ring_decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/ring_decode.c b/src/lib/ring_decode.c
index c3b5d18..a74229d 100644
--- a/src/lib/ring_decode.c
+++ b/src/lib/ring_decode.c
@@ -1819,7 +1819,7 @@ static void parse_next_sdma_pkt(struct umr_asic *asic, struct umr_ring_decoder *
case 2: printf("DST_ADDR_HI: %s0x%08lx%s", YELLOW, (unsigned long)ib, RST);
break;
case 3: printf("COUNT: %s0x%08lx%s", BLUE, (unsigned long)ib, RST);
- decoder->sdma.n_words += ib - 1;
+ decoder->sdma.n_words += ib;
break;
default: printf("DATA: %s0x%08lx%s", BLUE, (unsigned long)ib, RST);
break;
--
2.20.1
More information about the amd-gfx
mailing list