Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1117739ybh; Thu, 23 Jul 2020 00:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx258dEyOGC1seyqPg2oERkacCwyTJWQkBioQtLd0bR4DbaTBCriPFoOWF1l7SESuP5Aep8 X-Received: by 2002:a17:906:3e54:: with SMTP id t20mr2994086eji.471.1595489000110; Thu, 23 Jul 2020 00:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595489000; cv=none; d=google.com; s=arc-20160816; b=NPvyd6ytU2zS+fcRNmbGKnoX0SPwR+WxU9HxIUBf2hyT6ubaYhOXoHK/95JBaEeeWu WZMVd6K/Ee8LDn5p8REw+IEqdYWUjok1jeD3WsAQwvGvCLgAzTdHwvDoS16+PxczpGz3 PHMIQdh7UZpb4+7h4OtQ8njwGcRL0esYn+rCVHEGg/Szq958QvNE0+PzKwq/H+/RFygs wWt0gTmYEAgfFyDxfNtoFKlztRr+xqxikbgh73n0xHv64eLfFPk7B9/rVUJc3s5mwa4p i9oD2RoV2Jtkhz4gpCN0+uU1mDejGDxcFtwNZR2DByxDFYhhY0FHmfvVs5fHg2Tu7uFI 3vJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=tS++On5n6dPT0wGkfJ70X6NQV6p3IKFxCFm44bfRQtM=; b=t1PUBbur3XMX+NfXuD6AIoRJVSsolJaK6uq1sDGfCqFpgnv3HL1Ho5WP3cEArH+g+I 70xnjdYD72K7eceJ62uOdWr0foVQm9FWO7fsfDBEToylzI6NX4VA3Rx7HjZImeRoxRp7 HQaY8Iu2luQi2X/47pVjBbCuWG72oM/n1T7CTBbdmb4KFaWOOA5uA9itYiaUj7/rr/Qg Rk99tnkPSdKSXDpLfj3ErSphNCoOeE9n+0+vgWsN0azQBRroCAR7/oWO+6EowmpM11mp X4WbpbtqnxIjKdTefuLi5DP21Id+Gy9x06Myt+btUlcWkD7gF0GcLaGYhAnzc4PwRpQf aabg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw21si1497322ejb.302.2020.07.23.00.22.45; Thu, 23 Jul 2020 00:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbgGWHVy (ORCPT + 99 others); Thu, 23 Jul 2020 03:21:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8354 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725857AbgGWHVy (ORCPT ); Thu, 23 Jul 2020 03:21:54 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 05388A0E2D3C74B6F805; Thu, 23 Jul 2020 15:21:52 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Thu, 23 Jul 2020 15:21:43 +0800 From: Yang Shen To: , CC: , , Subject: [PATCH v3 04/10] crypto: hisilicon/qm - fix judgement of queue is full Date: Thu, 23 Jul 2020 15:19:34 +0800 Message-ID: <1595488780-22085-5-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595488780-22085-1-git-send-email-shenyang39@huawei.com> References: <1595488780-22085-1-git-send-email-shenyang39@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Hui Tang The queue depth is 1024, so the condition for judging the queue full should be 1023, otherwise the hardware cannot judge whether the queue is empty or full. Fixes: 263c9959c937("crypto: hisilicon - add queue management driver...") Signed-off-by: Hui Tang Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/qm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 406fca3..9a5a114 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -1646,7 +1646,7 @@ static void *qm_get_avail_sqe(struct hisi_qp *qp) struct hisi_qp_status *qp_status = &qp->qp_status; u16 sq_tail = qp_status->sq_tail; - if (unlikely(atomic_read(&qp->qp_status.used) == QM_Q_DEPTH)) + if (unlikely(atomic_read(&qp->qp_status.used) == QM_Q_DEPTH - 1)) return NULL; return qp->sqe + sq_tail * qp->qm->sqe_size; -- 2.7.4