From 43a48d4630eaec4850be5cd5a2c2655926876731 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Thu, 13 Feb 2025 17:06:41 +0200 Subject: [PATCH] drivers: dma: sdma: Update buffer descriptor count Some SDMA scripts (e.g multi-fifo) updates the buffer descriptor count field after a transfer is complete. Re-initialize the buffer descriptor to point to the correct transfer size for the next transfer. Signed-off-by: Daniel Baluta --- drivers/dma/dma_nxp_sdma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/dma_nxp_sdma.c b/drivers/dma/dma_nxp_sdma.c index fdd422d70d5..702562f2a4f 100644 --- a/drivers/dma/dma_nxp_sdma.c +++ b/drivers/dma/dma_nxp_sdma.c @@ -202,7 +202,9 @@ void dma_nxp_sdma_callback(sdma_handle_t *handle, void *userData, bool TransferD break; } + /* prepare next BD for transfer */ bd = &chan_data->bd_pool[bdIndex]; + bd->count = xfer_size; bd->status |= (uint8_t)kSDMA_BDStatusDone; SDMA_StartChannelSoftware(dev_cfg->base, chan_data->index);