]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/dma/dmatest.c
Pull misc-2.6.40 into release branch
[mv-sheeva.git] / drivers / dma / dmatest.c
index 5589358b684d7ab3e19cefe0bb83aa775ac59fda..e0888cb538d4b0ffa65f733065cde71684a11039 100644 (file)
@@ -54,6 +54,11 @@ module_param(pq_sources, uint, S_IRUGO);
 MODULE_PARM_DESC(pq_sources,
                "Number of p+q source buffers (default: 3)");
 
+static int timeout = 3000;
+module_param(timeout, uint, S_IRUGO);
+MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), \
+               Pass -1 for infinite timeout");
+
 /*
  * Initialization patterns. All bytes in the source buffer has bit 7
  * set, all bytes in the destination buffer has bit 7 cleared.
@@ -285,7 +290,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)) {
@@ -294,7 +304,7 @@ static int dmatest_func(void *data)
                dma_addr_t dma_srcs[src_cnt];
                dma_addr_t dma_dsts[dst_cnt];
                struct completion cmp;
-               unsigned long tmo = msecs_to_jiffies(3000);
+               unsigned long tmo = msecs_to_jiffies(timeout);
                u8 align = 0;
 
                total_tests++;