Skip to content

Commit d1c72f6

Browse files
iuliana-prodanherbertx
authored andcommitted
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: 6a89f49 ("crypto: engine - support for parallel requests based on retry mechanism") Signed-off-by: Iuliana Prodan <[email protected]> Reported-by: Horia Geantă <[email protected]> Reviewed-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent ae4052c commit d1c72f6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

crypto/crypto_engine.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,10 @@ static void crypto_pump_requests(struct crypto_engine *engine,
169169
/*
170170
* If hardware queue is full (-ENOSPC), requeue request
171171
* regardless of backlog flag.
172-
* If hardware throws any other error code,
173-
* requeue only backlog requests.
174172
* Otherwise, unprepare and complete the request.
175173
*/
176174
if (!engine->retry_support ||
177-
((ret != -ENOSPC) &&
178-
!(async_req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG))) {
175+
(ret != -ENOSPC)) {
179176
dev_err(engine->dev,
180177
"Failed to do one request from queue: %d\n",
181178
ret);

0 commit comments

Comments
 (0)