From: Antoine Tenart Date: Mon, 26 Feb 2018 13:45:12 +0000 (+0100) Subject: crypto: inside-secure - wait for the request to complete if in the backlog X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4dc5475ae0375ea4f9283dfd9b2ddc91b20d4c4b;p=linux.git crypto: inside-secure - wait for the request to complete if in the backlog This patch updates the safexcel_hmac_init_pad() function to also wait for completion when the digest return code is -EBUSY, as it would mean the request is in the backlog to be processed later. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver") Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 4953a2a86c108..77268c9f16205 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -842,7 +842,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq, init_completion(&result.completion); ret = crypto_ahash_digest(areq); - if (ret == -EINPROGRESS) { + if (ret == -EINPROGRESS || ret == -EBUSY) { wait_for_completion_interruptible(&result.completion); ret = result.error; }