linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
@ 2019-06-18 19:09 Haren Myneni
  2019-06-27  6:26 ` Herbert Xu
  2019-06-28  4:19 ` Herbert Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Haren Myneni @ 2019-06-18 19:09 UTC (permalink / raw)
  To: mpe, herbert; +Cc: linuxppc-dev, linux-crypto, stable

    
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>

diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c
index 4acbc47..e78ff5c 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -27,8 +27,6 @@
 #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
    



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
  2019-06-18 19:09 [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO Haren Myneni
@ 2019-06-27  6:26 ` Herbert Xu
  2019-06-28  1:43   ` Michael Ellerman
  2019-06-28  4:19 ` Herbert Xu
  1 sibling, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2019-06-27  6:26 UTC (permalink / raw)
  To: Haren Myneni; +Cc: linuxppc-dev, linux-crypto, stable

Haren Myneni <haren@linux.vnet.ibm.com> wrote:
>    
> 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>

I presume this is being picked up by the powerpc tree?

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
  2019-06-27  6:26 ` Herbert Xu
@ 2019-06-28  1:43   ` Michael Ellerman
  2019-06-28  2:07     ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2019-06-28  1:43 UTC (permalink / raw)
  To: Herbert Xu, Haren Myneni; +Cc: linuxppc-dev, linux-crypto, stable

Herbert Xu <herbert@gondor.apana.org.au> writes:
> Haren Myneni <haren@linux.vnet.ibm.com> wrote:
>>    
>> 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>
>
> I presume this is being picked up by the powerpc tree?

No. I assumed you'd take it because it's in drivers/crypto.

If you want me to take it that's fine, just let me know.

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
  2019-06-28  1:43   ` Michael Ellerman
@ 2019-06-28  2:07     ` Herbert Xu
  2019-06-29 11:31       ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2019-06-28  2:07 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: stable, linuxppc-dev, linux-crypto, Haren Myneni

On Fri, Jun 28, 2019 at 11:43:16AM +1000, Michael Ellerman wrote:
>
> No. I assumed you'd take it because it's in drivers/crypto.
> 
> If you want me to take it that's fine, just let me know.

No that's fine Michael.  I'll pick it up.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
  2019-06-18 19:09 [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO Haren Myneni
  2019-06-27  6:26 ` Herbert Xu
@ 2019-06-28  4:19 ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2019-06-28  4:19 UTC (permalink / raw)
  To: Haren Myneni; +Cc: linuxppc-dev, linux-crypto, stable

On Tue, Jun 18, 2019 at 12:09:22PM -0700, Haren Myneni wrote:
>     
> 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>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
  2019-06-28  2:07     ` Herbert Xu
@ 2019-06-29 11:31       ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2019-06-29 11:31 UTC (permalink / raw)
  To: Herbert Xu; +Cc: stable, linuxppc-dev, linux-crypto, Haren Myneni

Herbert Xu <herbert@gondor.apana.org.au> writes:
> On Fri, Jun 28, 2019 at 11:43:16AM +1000, Michael Ellerman wrote:
>>
>> No. I assumed you'd take it because it's in drivers/crypto.
>> 
>> If you want me to take it that's fine, just let me know.
>
> No that's fine Michael.  I'll pick it up.

Thanks.

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-29 11:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 19:09 [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO Haren Myneni
2019-06-27  6:26 ` Herbert Xu
2019-06-28  1:43   ` Michael Ellerman
2019-06-28  2:07     ` Herbert Xu
2019-06-29 11:31       ` Michael Ellerman
2019-06-28  4:19 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).