@@ -2784,13 +2784,14 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
if (cppi5_desc_get_type(desc_vaddr) ==
CPPI5_INFO0_DESC_TYPE_VAL_HOST) {
- result->residue = cppi5_hdesc_get_pktlen(desc_vaddr);
- if (result->residue == d->residue)
- result->result = DMA_TRANS_NOERROR;
- else
+ result->residue = d->residue -
+ cppi5_hdesc_get_pktlen(desc_vaddr);
+ if (result->residue)
result->result = DMA_TRANS_ABORTED;
+ else
+ result->result = DMA_TRANS_NOERROR;
} else {
- result->residue = d->residue;
+ result->residue = 0;
result->result = DMA_TRANS_NOERROR;
}
}
The residue should show the number of _not_ completed bytes, so it has to be 0 when the full transfer is completed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- drivers/dma/ti/k3-udma.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)