Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1503833pxa; Sun, 16 Aug 2020 00:26:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT6gm5iyIotnzRmBJ25V68gfJV0mSROc6HfMlV5Re2LNWBvSaYGe5ndiNCCo2niK6p14Mm X-Received: by 2002:aa7:c6c3:: with SMTP id b3mr9936442eds.215.1597562774612; Sun, 16 Aug 2020 00:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597562774; cv=none; d=google.com; s=arc-20160816; b=KVpUDNYyWyYCkF34YBxA/MkaQHQ9KUVKGk8sT07QR6VqL5yOVn/rZmgU57KaM+Afiw Ci2dkH3UfOINbsriO3H3+BTM6IiBSZJXOZicW0pmlUlZjX1k5z5son/vLQxbzyk5TjQD fsFFty6/OA7c+Rjn6M4NfLmsBRxBdu6seTPRqi7ce5f7nwM782lRVa4qZVMU69le2Cnq pS5J/dqm1L+PyNHwGUZmluMs6NaUZYHkQxLRxV0xmaul/B+DF90XG76mCoTbhN8r31TC hV1rOJfdpdXXx/Y3yWAb0tBwzNE3QdRiJIzoft3eoevCp5hsAumR9zR0Zst+GoLTfodt Jdiw== 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=DBYerKFYeB4NJ3lOgKtfXVJ7FlVqs2DVrL+QAO/1ffc=; b=uzieHLsvVPUbkE+IhS040/Wsgz8hwrLsJbxfWy6nHqzsEZCqQmJZaPvU4n+we0uO73 FPEKXFtz7AHTJ3W4rvxMYMTmEC3KAPaSg9eZopdNbynnJkxybbzrgHPbJ/sbl+9llnDv CpgXvUsDhxOyxTrZJzRkC0Pmo+YXyhkIOLSt1/hPkNFz+4A+F5Y5wBcvfbRbcu96heje 9Wu44xYfsX+vxep89tE177nenlQ5+4aTt4QocyeQbHN06P3juU0Q3UVILg0vmZLmoa8U q8axI+V7cS4pqi7ucm4X8rhPz5P1NFQtklunvptZRWKiZfWigwO5kUzRaRcf5+Cpfv5c be4w== 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 gq5si8794971ejb.162.2020.08.16.00.25.51; Sun, 16 Aug 2020 00:26:14 -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 S1729604AbgHPBog (ORCPT + 99 others); Sat, 15 Aug 2020 21:44:36 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33856 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729405AbgHPBoS (ORCPT ); Sat, 15 Aug 2020 21:44:18 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id F220228B65B471A81098; Sat, 15 Aug 2020 17:58:33 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Sat, 15 Aug 2020 17:58:24 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH v5 04/10] crypto: hisilicon/qm - fix judgement of queue is full Date: Sat, 15 Aug 2020 17:56:11 +0800 Message-ID: <1597485377-2678-5-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1597485377-2678-1-git-send-email-shenyang39@huawei.com> References: <1597485377-2678-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 95a1b6c..b9bff96 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -1647,7 +1647,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