]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: engine - do not requeue in case of fatal error
authorIuliana Prodan <iuliana.prodan@nxp.com>
Tue, 19 May 2020 22:17:25 +0000 (01:17 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 May 2020 07:27:52 +0000 (17:27 +1000)
commitf7e041afefe9b0160263ef73b8905442c7f540a6
tree075228d2b475912ff9960ba7e1f2802156d69909
parent30993ea3b88c84daa41f7ca64751c05f9cc79cd4
crypto: engine - do not requeue in case of fatal error

Now, in crypto-engine, if hardware queue is full (-ENOSPC),
requeue request regardless of MAY_BACKLOG flag.
If hardware throws any other error code (like -EIO, -EINVAL,
-ENOMEM, etc.) only MAY_BACKLOG requests are enqueued back into
crypto-engine's queue, since the others can be dropped.
The latter case can be fatal error, so those cannot be recovered from.
For example, in CAAM driver, -EIO is returned in case the job descriptor
is broken, so there is no possibility to fix the job descriptor.
Therefore, these errors might be fatal error, so we shouldn’t
requeue the request. This will just be pass back and forth between
crypto-engine and hardware.

Fixes: 723c3d4aebbf ("crypto: engine - support for parallel requests based on retry mechanism")
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reported-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/crypto_engine.c