Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2977595ybt; Mon, 29 Jun 2020 11:58:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXdtav2VTc/DdcIhF7eLjoTdkPQJHnBQ+1VDoUH6Oc12fmyQ4H+irgh14uenw/2q1USDac X-Received: by 2002:aa7:c31a:: with SMTP id l26mr18465568edq.61.1593457130109; Mon, 29 Jun 2020 11:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457130; cv=none; d=google.com; s=arc-20160816; b=O9Y9g7fKyYbS2JwtGbv/FT91WC8BCo+rVMrWUeXtXyswicmEx4ur9rFI4/vJpWLGYM AccRuZn4pa8VEbyREz0xqmMbzcX8fcvxBXzJTYSxWG5bTZdt5CBMMtwRdHrkPuLvt4XW ExJSk4WL0mfpGP1o71UmKDaIy7Umz1uOetPSnGnX19jLukaYFJwSRAzpE7dWYbIXvPIQ oIQsJs/ccR0d8oF/TP8O8JlNe1139Wbpj1LPtLG5aM4dE/Z5bfcnIS87QMmcmZlGwstk j9Zt3CbZor/otGF6DKKmGZfN25YFLWsxEw0TGw0N1xjqmottu8YmvtR9lvjo6qMTZ17e lJIQ== 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=4VdpvbwY5e3/CXKtfSsmKwSKpGlDd5YJwGsbs/1IvnA=; b=n4y1N/8do7cjlcZNJonrzzhKTk5ekuPN6KHAWQH92evvfsjtat5XE0uuCkipwMTMmc CaGafwX8wI09Td15ZrbPrrVC6MgykjEELZV87LspgNf8YZ7rQOzN0Jkix142xxjJRaMx YdAzzDVbCFU8JPQ5eJJhdZ3b5LXF3f0VfcmD3idwdfFiGLIwKfsOMTqHB+81bW71erqj LzGsk6xzXC2kD8XUbtrRGxV9apqzbv2rd79ivXvKaUpYL7ByLuq3Buep+va8C22UOWd9 yKc8g4ZCdJIVjyc4DbxJ0jWOkc30QtITg5cXeP//EgoThptDc/+AmVlLd2LKH1InJcTy RB/A== 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 u5si222018edp.123.2020.06.29.11.58.26; Mon, 29 Jun 2020 11:58:50 -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 S1729129AbgF2S5G (ORCPT + 99 others); Mon, 29 Jun 2020 14:57:06 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59522 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726958AbgF2S5D (ORCPT ); Mon, 29 Jun 2020 14:57:03 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 26E851BEE3FD16902541; Mon, 29 Jun 2020 19:10:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 29 Jun 2020 19:10:45 +0800 From: Yang Shen To: , CC: , , Subject: [PATCH 4/9] crypto: hisilicon/qm - fix judgement of queue is full Date: Mon, 29 Jun 2020 19:09:03 +0800 Message-ID: <1593428948-64634-5-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593428948-64634-1-git-send-email-shenyang39@huawei.com> References: <1593428948-64634-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: Shukun Tan --- 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 095ebf0..93f443c 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -1655,7 +1655,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