crypto: inside-secure - stop requeueing failed requests
This update the dequeue function of the inside-secure safexcel driver so that failed requests aren't requeued when they fail (for whatever reason, which can be because the hw ring is full). Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
86671abbbb
commit
c5acabd33c
|
@ -439,20 +439,22 @@ void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring)
|
||||||
goto finalize;
|
goto finalize;
|
||||||
|
|
||||||
request = kzalloc(sizeof(*request), EIP197_GFP_FLAGS(*req));
|
request = kzalloc(sizeof(*request), EIP197_GFP_FLAGS(*req));
|
||||||
if (!request)
|
if (!request) {
|
||||||
goto requeue;
|
|
||||||
|
|
||||||
ctx = crypto_tfm_ctx(req->tfm);
|
|
||||||
ret = ctx->send(req, ring, request, &commands, &results);
|
|
||||||
if (ret) {
|
|
||||||
kfree(request);
|
|
||||||
requeue:
|
|
||||||
spin_lock_bh(&priv->ring[ring].queue_lock);
|
spin_lock_bh(&priv->ring[ring].queue_lock);
|
||||||
crypto_enqueue_request(&priv->ring[ring].queue, req);
|
crypto_enqueue_request(&priv->ring[ring].queue, req);
|
||||||
spin_unlock_bh(&priv->ring[ring].queue_lock);
|
spin_unlock_bh(&priv->ring[ring].queue_lock);
|
||||||
|
|
||||||
priv->ring[ring].need_dequeue = true;
|
priv->ring[ring].need_dequeue = true;
|
||||||
continue;
|
goto finalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx = crypto_tfm_ctx(req->tfm);
|
||||||
|
ret = ctx->send(req, ring, request, &commands, &results);
|
||||||
|
if (ret) {
|
||||||
|
kfree(request);
|
||||||
|
req->complete(req, ret);
|
||||||
|
priv->ring[ring].need_dequeue = true;
|
||||||
|
goto finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backlog)
|
if (backlog)
|
||||||
|
|
Loading…
Reference in New Issue