aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-04-28 12:11:51 +0100
committerMark Brown <broonie@kernel.org>2023-04-28 12:11:51 +0100
commitb122cc00800606a95b3c858180cc96c3da1b8a15 (patch)
tree1fadad4ca3b5e841c9e796917f9845c7d4a0c10f
parentc62eebbcf92b0546342967d876e061944329bc8e (diff)
parent4140aafcff167b5b9e8dae6a1709a6de7cac6f74 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
-rw-r--r--crypto/algapi.c3
-rw-r--r--crypto/crypto_engine.c6
-rw-r--r--drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index d7eb8f9e9883..5e7cd603d489 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -961,6 +961,9 @@ EXPORT_SYMBOL_GPL(crypto_enqueue_request);
void crypto_enqueue_request_head(struct crypto_queue *queue,
struct crypto_async_request *request)
{
+ if (unlikely(queue->qlen >= queue->max_qlen))
+ queue->backlog = queue->backlog->prev;
+
queue->qlen++;
list_add(&request->list, &queue->list);
}
diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c
index 21f791615114..74fcc0897041 100644
--- a/crypto/crypto_engine.c
+++ b/crypto/crypto_engine.c
@@ -129,9 +129,6 @@ start_request:
if (!engine->retry_support)
engine->cur_req = async_req;
- if (backlog)
- crypto_request_complete(backlog, -EINPROGRESS);
-
if (engine->busy)
was_busy = true;
else
@@ -217,6 +214,9 @@ req_err_2:
crypto_request_complete(async_req, ret);
retry:
+ if (backlog)
+ crypto_request_complete(backlog, -EINPROGRESS);
+
/* If retry mechanism is supported, send new requests to engine */
if (engine->retry_support) {
spin_lock_irqsave(&engine->queue_lock, flags);
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
index 83c6dfad77e1..16966cc94e24 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
@@ -151,7 +151,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)
}
rctx->p_iv[i] = a;
/* we need to setup all others IVs only in the decrypt way */
- if (rctx->op_dir & SS_ENCRYPTION)
+ if (rctx->op_dir == SS_ENCRYPTION)
return 0;
todo = min(len, sg_dma_len(sg));
len -= todo;