dmaengine: ti: k3-udma: Fix the TR initialization for prep_slave_sg
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 24 Aug 2020 12:01:08 +0000 (15:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:16 +0000 (19:14 +0200)
commitf276f4e1b7431572d124a225bda00cea87fe4e5f
tree3be4f69227afab52ff013d09497691a2821bac4a
parent1185d129364a37e3e3a8fdc230eecece201a5ebb
dmaengine: ti: k3-udma: Fix the TR initialization for prep_slave_sg

[ Upstream commit 33ebffa105990c43bf336cabe26c77384f59fe70 ]

The TR which needs to be initialized for the next sg entry is indexed by
tr_idx and not by the running i counter.

In case any sub element in the SG needs more than one TR, the code would
corrupt an already configured TR.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200824120108.9178-1-peter.ujfalusi@ti.com
Fixes: 6cf668a4ef829 ("dmaengine: ti: k3-udma: Use the TR counter helper for slave_sg and cyclic")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ti/k3-udma.c