]> 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)
commit21eb6cb315cb02151fdb858a7afbcc15fc7ee1b4
tree250ae0ae69c525356cc38de12872a6ac3defac41
parente466de3a08e819b04793011819b79cc4c4e1c3f5
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