From a36e63bb79674802d76b00db09d6e8066bb7d935 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Fri, 24 Apr 2026 22:10:47 +0200 Subject: [PATCH] Fix DMA rounding issue --- iop/cmdHandler.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iop/cmdHandler.c b/iop/cmdHandler.c index c753cd7..ea7e38f 100644 --- a/iop/cmdHandler.c +++ b/iop/cmdHandler.c @@ -129,6 +129,7 @@ unsigned int pkoSendSifCmd(unsigned int cmd, void *src, unsigned int len) { unsigned int dmaId; + unsigned int dmaLen; rpc_data[0] = cmd; @@ -137,7 +138,12 @@ pkoSendSifCmd(unsigned int cmd, void *src, unsigned int len) len = len > sizeof(rpc_data) ? sizeof(rpc_data) : len; - dmaId = pkoSetSifDma(PKO_DMA_DEST, rpc_data, len, 4); + /* Round DMA size up to 16-byte boundary — real HW SIF DMA + requires aligned transfer sizes. rpc_data is 1KB so the + extra bytes are just trailing zeros. */ + dmaLen = (len + 15) & ~15; + + dmaId = pkoSetSifDma(PKO_DMA_DEST, rpc_data, dmaLen, 4); if (dmaId == 0) { printf("IOP: sifSendCmd %x failed\n", cmd);