Thread (24 messages) flat view 24 messages, 2 authors, 2016-06-17

Re: [PATCH 3/7] crypto: marvell: Copy IV vectors by DMA transfers for acipher requests

From: Boris Brezillon <hidden>
Date: 2016-06-15 20:48:15
Also in: linux-arm-kernel

On Wed, 15 Jun 2016 21:15:30 +0200
Romain Perier [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -135,23 +140,23 @@ static int mv_cesa_ablkcipher_process(struct crypto_async_request *req,
 {
 	struct ablkcipher_request *ablkreq = ablkcipher_request_cast(req);
 	struct mv_cesa_ablkcipher_req *creq = ablkcipher_request_ctx(ablkreq);
-	struct mv_cesa_ablkcipher_std_req *sreq = &creq->req.std;
-	struct mv_cesa_engine *engine = sreq->base.engine;
-	int ret;
 
-	if (creq->req.base.type == CESA_DMA_REQ)
+	if (creq->req.base.type == CESA_DMA_REQ) {
+		int ret;
+		struct mv_cesa_tdma_req *dreq;
+		unsigned int ivsize;
+
 		ret = mv_cesa_dma_process(&creq->req.dma, status);
-	else
-		ret = mv_cesa_ablkcipher_std_process(ablkreq, status);
+		if (ret)
+			return ret;
 
-	if (ret)
+		dreq = &creq->req.dma;
+		ivsize = crypto_ablkcipher_ivsize(
+					     crypto_ablkcipher_reqtfm(ablkreq));
+		memcpy_fromio(ablkreq->info, dreq->chain.last->data, ivsize);
Just use memcpy() here: you're not copying from an iomem region here.

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help