OSDN Git Service

dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow
authorVaishnav Achath <vaishnav.a@ti.com>
Tue, 2 Aug 2022 05:48:35 +0000 (11:18 +0530)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Sep 2022 06:15:13 +0000 (11:45 +0530)
commit7c94dcfa8fcff2dba53915f1dabfee49a3df8b88
tree6aadb06eeba61a4041755b40d469fee6e7403474
parent493c1141f791a0a8af5d1745bdf9f159f564ca3f
dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow

UDMA_CHAN_RT_*BCNT_REG stores the real-time channel bytecount statistics.
These registers are 32-bit hardware counters and the driver uses these
counters to monitor the operational progress status for a channel, when
transferring more than 4GB of data it was observed that these counters
overflow and completion calculation of a operation gets affected and the
transfer hangs indefinitely.

This commit adds changes to decrease the byte count for every complete
transaction so that these registers never overflow and the proper byte
count statistics is maintained for ongoing transaction by the RT counters.

Earlier uc->bcnt used to maintain a count of the completed bytes at driver
side, since the RT counters maintain the statistics of current transaction
now, the maintenance of uc->bcnt is not necessary.

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20220802054835.19482-1-vaishnav.a@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma.c