Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 603e989e authored by Romain Perier's avatar Romain Perier Committed by Herbert Xu
Browse files

crypto: marvell - Don't chain at DMA level when backlog is disabled



The flag CRYPTO_TFM_REQ_MAY_BACKLOG is optional and can be set from the
user to put requests into the backlog queue when the main cryptographic
queue is full. Before calling mv_cesa_tdma_chain we must check the value
of the return status to be sure that the current request has been
correctly queued or added to the backlog.

Fixes: 85030c51 ("crypto: marvell - Add support for chaining...")
Signed-off-by: default avatarRomain Perier <romain.perier@free-electrons.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ec38f82e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -180,10 +180,11 @@ int mv_cesa_queue_req(struct crypto_async_request *req,
	struct mv_cesa_engine *engine = creq->engine;

	spin_lock_bh(&engine->lock);
	if (mv_cesa_req_get_type(creq) == CESA_DMA_REQ)
		mv_cesa_tdma_chain(engine, creq);

	ret = crypto_enqueue_request(&engine->queue, req);
	if ((mv_cesa_req_get_type(creq) == CESA_DMA_REQ) &&
	    (ret == -EINPROGRESS ||
	    (ret == -EBUSY && req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)))
		mv_cesa_tdma_chain(engine, creq);
	spin_unlock_bh(&engine->lock);

	if (ret != -EINPROGRESS)