dmaengine: imx-sdma: find desc first in sdma_tx_status
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 16 Dec 2019 10:53:27 +0000 (11:53 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 26 Dec 2019 04:34:19 +0000 (10:04 +0530)
commita1ff6a07f5a3951fcac84f064a76d1ad79c10e40
tree9cf1ff5b272e907ff00dbf317e360ecd04eb36a9
parenta80f2787f1ff0fd068fdcb8fd949a992029b6f25
dmaengine: imx-sdma: find desc first in sdma_tx_status

In sdma_tx_status() we must first find the current sdma_desc. In cyclic
mode we assume that this can always be found with vchan_find_desc().
This is true because do not remove the current descriptor from the
desc_issued list:

/*
 * Do not delete the node in desc_issued list in cyclic mode, otherwise
 * the desc allocated will never be freed in vchan_dma_desc_free_list
 */
if (!(sdmac->flags & IMX_DMA_SG_LOOP))
list_del(&vd->node);

We will change this in the next step, so check if the current descriptor is
the desired one also for the cyclic case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20191216105328.15198-9-s.hauer@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/imx-sdma.c