]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: ti: k3-udma: Workaround for RX teardown with stale data in peer
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 14 Feb 2020 09:14:37 +0000 (11:14 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 19 Feb 2020 07:39:10 +0000 (13:09 +0530)
commit7487fc88fccdd95ec26106f0346b67be3eeddf05
tree1f4719862561790e6bbbea727e1728c70f983b8b
parentba999d36ab6915ca6d2773f7480673eb3ef09505
dmaengine: ti: k3-udma: Workaround for RX teardown with stale data in peer

When a channel is asked to be stopped (teardown) and we do not have active
descriptor to receive stale data buffered on the remote side then the
teardown will not complete as UDMA needs a descriptor to be able to flush
out the DMA pipe.
The peer is trying to push the data to UDMA in teardown, but UDMA is
pushing back because it has no descriptor which would allow it to drain the
data.

The workaround is to create 1K 'trashcan' to receive the discarded data and
set up descriptors for packet and TR mode channels.
When a channel is stopped and there is no active descriptor then a
descriptor is pushed to the ring for UDMA before the teardown is initiated.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200214091441.27535-3-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma.c