Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:21 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:30 +0200
commit8a9563b199ccad3b389b8e2be3d393f2dcbe8a62 (patch)
tree626b1a0a4748a6236449baf6db725b9b606c5f23
parent04924a191773d5ab37af1623f265e8bc9c577c2d (diff)
crypto/NX: Set receive window credits to max number of CRBs
in RxFIFO (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.2-020-crypto-NX-Set-receive-window-credits-to-max-num.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.2-020-crypto-NX-Set-receive-window-credits-to-max-num.patch b/patches.kernel.org/5.2.2-020-crypto-NX-Set-receive-window-credits-to-max-num.patch
new file mode 100644
index 0000000000..09974cd03b
--- /dev/null
+++ b/patches.kernel.org/5.2.2-020-crypto-NX-Set-receive-window-credits-to-max-num.patch
@@ -0,0 +1,55 @@
+From: Haren Myneni <haren@linux.vnet.ibm.com>
+Date: Tue, 18 Jun 2019 12:09:22 -0700
+Subject: [PATCH] crypto/NX: Set receive window credits to max number of CRBs
+ in RxFIFO
+References: bnc#1012628
+Patch-mainline: 5.2.2
+Git-commit: e52d484d9869eb291140545746ccbe5ffc7c9306
+
+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>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/crypto/nx/nx-842-powernv.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c
+index 4acbc47973e9..e78ff5c65ed6 100644
+--- a/drivers/crypto/nx/nx-842-powernv.c
++++ b/drivers/crypto/nx/nx-842-powernv.c
+@@ -27,8 +27,6 @@ MODULE_ALIAS_CRYPTO("842-nx");
+ #define WORKMEM_ALIGN (CRB_ALIGN)
+ #define CSB_WAIT_MAX (5000) /* ms */
+ #define VAS_RETRIES (10)
+-/* # of requests allowed per RxFIFO at a time. 0 for unlimited */
+-#define MAX_CREDITS_PER_RXFIFO (1024)
+
+ struct nx842_workmem {
+ /* Below fields must be properly aligned */
+@@ -812,7 +810,11 @@ static int __init vas_cfg_coproc_info(struct device_node *dn, int chip_id,
+ rxattr.lnotify_lpid = lpid;
+ rxattr.lnotify_pid = pid;
+ rxattr.lnotify_tid = tid;
+- rxattr.wcreds_max = MAX_CREDITS_PER_RXFIFO;
++ /*
++ * Maximum RX window credits can not be more than #CRBs in
++ * RxFIFO. Otherwise, can get checkstop if RxFIFO overruns.
++ */
++ rxattr.wcreds_max = fifo_size / CRB_SIZE;
+
+ /*
+ * Open a VAS receice window which is used to configure RxFIFO
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 9b5fce98d1..fa65fa12d2 100644
--- a/series.conf
+++ b/series.conf
@@ -107,6 +107,7 @@
patches.kernel.org/5.2.2-017-s390-qdio-don-t-touch-the-dsci-in-tiqdio_add_in.patch
patches.kernel.org/5.2.2-018-crypto-talitos-move-struct-talitos_edesc-into-t.patch
patches.kernel.org/5.2.2-019-crypto-talitos-fix-hash-on-SEC1.patch
+ patches.kernel.org/5.2.2-020-crypto-NX-Set-receive-window-credits-to-max-num.patch
########################################################
# Build fixes that apply to the vanilla kernel too.