lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1352109631-3385-16-git-send-email-b.zolnierkie@samsung.com>
Date:	Mon, 05 Nov 2012 11:00:26 +0100
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	linux-kernel@...r.kernel.org
Cc:	djbw@...com, dwmw2@...radead.org, hskinnemoen@...il.com,
	iws@...o.caltech.edu, vinod.koul@...el.com, vipin.kumar@...com,
	t.figa@...sung.com, kyungmin.park@...sung.com,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: [PATCH 15/20] dmatest: do DMA unmap for PQ operations

Make driver do DMA unmap for PQ operations.

Cc: Vinod Koul <vinod.koul@...el.com>
Cc: Havard Skinnemoen <hskinnemoen@...il.com>
Cc: Tomasz Figa <t.figa@...sung.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@...sung.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ