dmatest: fix automatic buffer unmap type
authorIra Snyder <iws@ovro.caltech.edu>
Thu, 3 Mar 2011 07:54:53 +0000 (07:54 +0000)
committerDan Williams <dan.j.williams@intel.com>
Sat, 12 Mar 2011 01:52:35 +0000 (17:52 -0800)
The dmatest code relies on the DMAEngine API to automatically call
dma_unmap_single() on src buffers. The flags it passes are incorrect,
fix them.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmatest.c

index 5589358b684d7ab3e19cefe0bb83aa775ac59fda..7e1b0aa0ca50808d4c5dce0f94dc166fe10f9255 100644 (file)
@@ -285,7 +285,12 @@ static int dmatest_func(void *data)
 
        set_user_nice(current, 10);
 
-       flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT;
+       /*
+        * src buffers are freed by the DMAEngine code with dma_unmap_single()
+        * dst buffers are freed by ourselves below
+        */
+       flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT
+             | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE;
 
        while (!kthread_should_stop()
               && !(iterations && total_tests >= iterations)) {