crypto: inside-secure - wait for the request to complete if in the backlog
authorAntoine Tenart <antoine.tenart@bootlin.com>
Mon, 26 Feb 2018 13:45:12 +0000 (14:45 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Mar 2018 14:45:31 +0000 (22:45 +0800)
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 <oferh@marvell.com>
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_hash.c

index 4953a2a86c1088c2ec765a742b786faedc1c3136..77268c9f16205b4c069ace8959216ffbdfaa336c 100644 (file)
@@ -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;
                }