Re: EXT: [PATCH v2] dmaengine: imx-sdma - correct the dma transfer residue calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26/02/17 14:44, Fabio Estevam wrote:
From: Nandor Han <nandor.han@xxxxxx>

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.

Cc: <stable@xxxxxxxxxxxxxxx> # 4.9.x
Fixes: 5881826ded79cf3 ("dmaengine: imx-sdma - update the residue calculation for cyclic channels")
Signed-off-by: Nandor Han <nandor.han@xxxxxx>
Acked-by: Peter Senna Tschudin <peter.senna@xxxxxxxxxxxxx>
Tested-by: Peter Senna Tschudin <peter.senna@xxxxxxxxxxxxx>
Tested-by: Marek Vasut <marex@xxxxxxx>
Signed-off-by: Vinod Koul <vinod.koul@xxxxxxxxx>
Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx>
---
Currently 4.9 exhibits broken audio without this patch as
reported by Alexandre Belloni at:
http://lists.infradead.org/pipermail/linux-arm-kernel/2017-February/488393.html

This fixes 5881826ded79cf3 ("dmaengine: imx-sdma - update the residue
calculation for cyclic channels")

Changes since v1:
- Add my Signed-off-by
- Add Fixes tag
- Explain why we need this for 4.9 below the --- line.

Acked-by: Nandor Han <nandor.han@xxxxxx>

<snip>

Regards,
     Nandor



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]