crypto: cavium - Limit result reading attempts
authorJan Glauber <jglauber@cavium.com>
Mon, 9 Apr 2018 15:45:51 +0000 (17:45 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Apr 2018 16:58:35 +0000 (00:58 +0800)
commitc782a8c43e94ba6c09e9de2d69b5e3a5840ce61c
tree250ae0ae69c525356cc38de12872a6ac3defac41
parent37ff02acaa3d7be87ecb89f198a549ffd3ae2403
crypto: cavium - Limit result reading attempts

After issuing a request an endless loop was used to read the
completion state from memory which is asynchronously updated
by the ZIP coprocessor.

Add an upper bound to the retry attempts to prevent a CPU getting stuck
forever in case of an error. Additionally, add a read memory barrier
and a small delay between the reading attempts.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Reviewed-by: Robert Richter <rrichter@cavium.com>
Cc: stable <stable@vger.kernel.org> # 4.14
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/cavium/zip/common.h
drivers/crypto/cavium/zip/zip_deflate.c
drivers/crypto/cavium/zip/zip_inflate.c