Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3a654a85 authored by Nandor Han's avatar Nandor Han Committed by Greg Kroah-Hartman
Browse files

dmaengine: imx-sdma - correct the dma transfer residue calculation



commit 85f57752b33cf12f1d583f0c10b752292de00abe upstream.

The residue calculation was taking in consideration that dma
transaction status will be always retrieved in the dma callback
used to inform that dma transfer is complete. However this is not
the case for all subsystems that use dma. Some subsystems use a
timer to check the dma status periodically.

Therefore the calculation was updated and residue is calculated
accordingly by a) update the residue calculation taking in
consideration the last used buffer index by using *buf_ptail* variable
and b) chn_real_count (number of bytes transferred) is initialized to
zero, when dma channel is created, to avoid using an uninitialized
value in residue calculation when dma status is checked without
waiting dma complete event.

Signed-off-by: default avatarNandor Han <nandor.han@ge.com>
Acked-by: default avatarPeter Senna Tschudin <peter.senna@collabora.com>
Tested-by: default avatarPeter Senna Tschudin <peter.senna@collabora.com>
Tested-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Cc: Fabio Estevam <festevam@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 56a567de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment