Skip to content

Commit fddc009

Browse files
Raymond0225mmahadevan108
authored andcommitted
drivers: dma: edma: Pending length calculation incorrect
Pending length should be mainloop count multiply NBYTES of minor loops. Signed-off-by: Raymond Lei <[email protected]>
1 parent a77d499 commit fddc009

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dma/dma_mcux_edma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,10 @@ static int dma_mcux_edma_get_status(const struct device *dev, uint32_t channel,
544544

545545
if (DEV_CHANNEL_DATA(dev, channel)->busy) {
546546
status->busy = true;
547+
/* Be aware that here we need multiply NBYTES for each minor loops */
547548
status->pending_length =
548-
EDMA_GetRemainingMajorLoopCount(DEV_BASE(dev), hw_channel);
549+
EDMA_GetRemainingMajorLoopCount(DEV_BASE(dev), hw_channel) *
550+
DEV_CHANNEL_DATA(dev, channel)->transfer_settings.source_data_size;
549551
} else {
550552
status->busy = false;
551553
status->pending_length = 0;

0 commit comments

Comments
 (0)