Messages in this thread Patch in this message | | | From | Bartlomiej Zolnierkiewicz <> | Subject | [PATCH 05/20] dmatest: do DMA unmap for MEMCPY operations | Date | Mon, 05 Nov 2012 11:00:16 +0100 |
| |
Make driver do DMA unmap for MEMCPY operations.
Cc: Vinod Koul <vinod.koul@intel.com> Cc: Havard Skinnemoen <hskinnemoen@gmail.com> Cc: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> --- drivers/dma/dmatest.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 24225f0..22655a7 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -306,10 +306,16 @@ static int dmatest_func(void *data) /* * src buffers are freed by the DMAEngine code with dma_unmap_single() + * (except DMA_MEMCPY operations) * dst buffers are freed by ourselves below */ flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT - | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE; + | DMA_COMPL_SKIP_DEST_UNMAP; + + if (thread->type == DMA_MEMCPY) + flags |= DMA_COMPL_SKIP_SRC_UNMAP; + else + flags |= DMA_COMPL_SRC_UNMAP_SINGLE; while (!kthread_should_stop() && !(iterations && total_tests >= iterations)) { @@ -443,6 +449,9 @@ static int dmatest_func(void *data) } /* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */ + if (thread->type == DMA_MEMCPY) + dma_unmap_single(dev->dev, dma_srcs[0], len, + DMA_TO_DEVICE); for (i = 0; i < dst_cnt; i++) dma_unmap_single(dev->dev, dma_dsts[i], test_buf_size, DMA_BIDIRECTIONAL); -- 1.8.0
| |