Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3721755ybi; Tue, 18 Jun 2019 05:36:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6VZo+YurvUT4SUUuJRH/JPtW+1elkHXRA/ob2Jc6iJEMBMqs+2kAL1Y6WZBh6uh68URDG X-Received: by 2002:a17:90a:3ac2:: with SMTP id b60mr5001960pjc.74.1560861386692; Tue, 18 Jun 2019 05:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560861386; cv=none; d=google.com; s=arc-20160816; b=CeadGdWvdjOuv4Y1vXaTxJHnWylwxzEGLl+unN47dSMvgzopMPrI5o/MYIYnGSpySR aRKKrk00mqz0ThaXAtPIZm16ITG9MrjZJG4t+QvIL3+zxuE/Lzjf/sQW2x1MiLgL9Dwn clJOthCwDq56HgAvd5mCJ72jpeHMJrMIiAwehszINAPgT+cyS8an1LHMbHrEOljDKP3S Da5Bk7qNcrPmFWUObGdriqZRIZbYsXP4IZn5ifEmBGK/9me1/+uuhjtN5kMe0Gmm90Zk f1jk0cHlgMSV8+J7F0c7ErOuNw3LSADCqiABAit4P2TL9FhQnOHhHRE6xydJ47TsLs5n Qutw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=21CZ9+xyYMt9VoVUpgbd5rkB3a4lgfnDGQ5sUNZvJYM=; b=QDNUkUqqV+aM4cPl8vB6LtVWQYmBNun7a/ZGGl1oD5YAj15gcZlR5v8iM/2wkyFIwv QgZqq+AqSug7cgbyMxloTi5I0cf+f5AViuKBFAT7rZjz9hoH46qUgd8sE/obu6rRH0yv N101vMtplnBsOXbgPjMeqUqJvT47BbP5NgXdzsCsWY7tj6h91FziNxZ3jQsyh4Qpuy8c 7unbl0GZpCiUEIXRLvStmefBXQR9MQIA2Vzhl1WCEhb7NpuirPFKmc6UPq6JCt7NbiQR Akq4CQEIPuxUtA0lJ+98Htr+hswCFKgyuMvCm8edmiYq/ZUpflpFAByU09CBiO7upuQG ozOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si12800361pfh.174.2019.06.18.05.36.08; Tue, 18 Jun 2019 05:36:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726047AbfFRMfO (ORCPT + 99 others); Tue, 18 Jun 2019 08:35:14 -0400 Received: from ozlabs.org ([203.11.71.1]:33411 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbfFRMfO (ORCPT ); Tue, 18 Jun 2019 08:35:14 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 45Snbh1HPKz9sDX; Tue, 18 Jun 2019 22:35:12 +1000 (AEST) From: Michael Ellerman To: Haren Myneni , Herbert Xu Cc: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org, stable@vger.kernel.org Subject: Re: crypto/NX: Set receive window credits to max number of CRBs in RxFIFO In-Reply-To: <1560587942.17547.18.camel@hbabu-laptop> References: <1560587942.17547.18.camel@hbabu-laptop> Date: Tue, 18 Jun 2019 22:35:05 +1000 Message-ID: <87ef3royva.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Haren Myneni writes: > > System gets checkstop if RxFIFO overruns with more requests than the > maximum possible number of CRBs in FIFO at the same time. So find max > CRBs from FIFO size and set it to receive window credits. > > CC: stable@vger.kernel.org # v4.14+ > Signed-off-by:Haren Myneni It's helpful to mention the actual commit that's fixed, so that people with backports can join things up, so should that be: Fixes: b0d6c9bab5e4 ("crypto/nx: Add P9 NX support for 842 compression engine") ??? cheers > 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