]> asedeno.scripts.mit.edu Git - linux.git/commit
dmaengine: ti: edma: Correct the residue calculation (fix for memcpy)
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 16 Jul 2019 08:26:54 +0000 (11:26 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 29 Jul 2019 06:41:38 +0000 (12:11 +0530)
commit097ffdc75259139ba157b7f924cfeb0d6b00559e
tree92637e9bf9919be8cf75b63a6d153e5b0c917810
parente96b1f64ee2885acb8fb26325eb9743ad6c64696
dmaengine: ti: edma: Correct the residue calculation (fix for memcpy)

For memcpy we never stored the start address of the transfer for the pset
which rendered the memcpy residue calculation completely broken.

In the edma_residue() function we also need to to some correction for the
calculations:
Instead waiting for all EDMA channels to be idle (in a busy system it can
take few iteration to hit a point when all queues are idle) wait for the
event pending on the given channel (SH_ER for hw synchronized channels,
SH_ESR for manually triggered channels).

If the position returned by EMDA is 0 it implies that the last paRAM set
has been consumed and we are at the closing dummy set, thus we can conclude
that the transfer is completed and we can return 0 as residue.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
[vkoul: fixed typo in commit log]
Link: https://lore.kernel.org/r/20190716082655.1620-3-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/edma.c