crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
authorHaren Myneni <haren@linux.vnet.ibm.com>
Tue, 18 Jun 2019 19:09:22 +0000 (12:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2019 07:03:16 +0000 (09:03 +0200)
commit820b010743ee55efe6cf2613e38672d8ce3e5555
tree85222a9f59fc65365df30348893fb0560797fc8b
parentb24c6403633d416b463eb90138f6a02aa9f591d0
crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

commit e52d484d9869eb291140545746ccbe5ffc7c9306 upstream.

System gets checkstop if RxFIFO overruns with more requests than the
maximum possible number of CRBs in FIFO at the same time. The max number
of requests per window is controlled by window credits. So find max
CRBs from FIFO size and set it to receive window credits.

Fixes: b0d6c9bab5e4 ("crypto/nx: Add P9 NX support for 842 compression engine")
CC: stable@vger.kernel.org # v4.14+
Signed-off-by:Haren Myneni <haren@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-842-powernv.c