]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:58:24 +0000 (09:58 +0200)
commite0b16bfbd3a4a8d09614046335f4482313e7c0c4
tree88ba1d946f2e60f2b449f637436852ca5be560ab
parent04e7cd8c85636a329d1a6e5a269a7c8b6f71c41c
dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow

[ Upstream commit 7c94dcfa8fcff2dba53915f1dabfee49a3df8b88 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ti/k3-udma.c