mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
crypto: marvell/cesa - Fix engine load inaccuracy
If an error occurs during queueing the engine load will never be
decremented. Fix this by moving the engine load adjustment into
the cleanup function.
Fixes: bf8f91e711 ("crypto: marvell - Add load balancing between engines")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
a091a58b8a
commit
442134ab30
|
|
@ -75,9 +75,12 @@ mv_cesa_skcipher_dma_cleanup(struct skcipher_request *req)
|
|||
static inline void mv_cesa_skcipher_cleanup(struct skcipher_request *req)
|
||||
{
|
||||
struct mv_cesa_skcipher_req *creq = skcipher_request_ctx(req);
|
||||
struct mv_cesa_engine *engine = creq->base.engine;
|
||||
|
||||
if (mv_cesa_req_get_type(&creq->base) == CESA_DMA_REQ)
|
||||
mv_cesa_skcipher_dma_cleanup(req);
|
||||
|
||||
atomic_sub(req->cryptlen, &engine->load);
|
||||
}
|
||||
|
||||
static void mv_cesa_skcipher_std_step(struct skcipher_request *req)
|
||||
|
|
@ -212,7 +215,6 @@ mv_cesa_skcipher_complete(struct crypto_async_request *req)
|
|||
struct mv_cesa_engine *engine = creq->base.engine;
|
||||
unsigned int ivsize;
|
||||
|
||||
atomic_sub(skreq->cryptlen, &engine->load);
|
||||
ivsize = crypto_skcipher_ivsize(crypto_skcipher_reqtfm(skreq));
|
||||
|
||||
if (mv_cesa_req_get_type(&creq->base) == CESA_DMA_REQ) {
|
||||
|
|
|
|||
|
|
@ -110,9 +110,12 @@ static inline void mv_cesa_ahash_dma_cleanup(struct ahash_request *req)
|
|||
static inline void mv_cesa_ahash_cleanup(struct ahash_request *req)
|
||||
{
|
||||
struct mv_cesa_ahash_req *creq = ahash_request_ctx(req);
|
||||
struct mv_cesa_engine *engine = creq->base.engine;
|
||||
|
||||
if (mv_cesa_req_get_type(&creq->base) == CESA_DMA_REQ)
|
||||
mv_cesa_ahash_dma_cleanup(req);
|
||||
|
||||
atomic_sub(req->nbytes, &engine->load);
|
||||
}
|
||||
|
||||
static void mv_cesa_ahash_last_cleanup(struct ahash_request *req)
|
||||
|
|
@ -392,8 +395,6 @@ static void mv_cesa_ahash_complete(struct crypto_async_request *req)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
atomic_sub(ahashreq->nbytes, &engine->load);
|
||||
}
|
||||
|
||||
static void mv_cesa_ahash_prepare(struct crypto_async_request *req,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user