]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6e2fb98f400ed2de0518764e77ff87e61f259e86
tree250ae0ae69c525356cc38de12872a6ac3defac41
parent94e779fbcc509dd4c07960aa6df1b269c01bf1b9
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