lkml.org 
[lkml]   [2012]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 15/20] dmatest: do DMA unmap for PQ operations
Date
Make driver do DMA unmap for PQ 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 | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index eabb230..3b36890 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -304,18 +304,9 @@ static int dmatest_func(void *data)

set_user_nice(current, 10);

- /*
- * src buffers are freed by the DMAEngine code with dma_unmap_single()
- * (except DMA_MEMCPY and DMA_XOR operations)
- * dst buffers are freed by ourselves below
- */
- flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT
- | DMA_COMPL_SKIP_DEST_UNMAP;
-
- if (thread->type == DMA_MEMCPY || thread->type == DMA_XOR)
- flags |= DMA_COMPL_SKIP_SRC_UNMAP;
- else
- flags |= DMA_COMPL_SRC_UNMAP_SINGLE;
+ /* src and dst buffers are freed by ourselves below */
+ flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT |
+ DMA_COMPL_SKIP_SRC_UNMAP | DMA_COMPL_SKIP_DEST_UNMAP;

while (!kthread_should_stop()
&& !(iterations && total_tests >= iterations)) {
@@ -448,12 +439,11 @@ static int dmatest_func(void *data)
continue;
}

- /* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */
- if (thread->type == DMA_MEMCPY || thread->type == DMA_XOR) {
- for (i = 0; i < src_cnt; i++)
- dma_unmap_single(dev->dev, dma_srcs[i], len,
- DMA_TO_DEVICE);
- }
+ /* Unmap by myself */
+ for (i = 0; i < src_cnt; i++)
+ dma_unmap_single(dev->dev, dma_srcs[i], 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


\
 
 \ /
  Last update: 2012-11-05 12:02    [W:0.141 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site