Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp381608ybt; Wed, 1 Jul 2020 00:25:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxM6xHIFBFfdLDT3qv0RLcTvSt5Nr+iODd6WXhC+9Rvb4Gxl9KXhz3nQwt/iTk032iKB81 X-Received: by 2002:a17:906:c943:: with SMTP id fw3mr21296514ejb.55.1593588315245; Wed, 01 Jul 2020 00:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593588315; cv=none; d=google.com; s=arc-20160816; b=K//ALTRbLV8VWR3mhwEpTPN1Ndkqy6KdFtmcmQC/fPh8fkX9hsSiKpE4+PPgifrLlf HWduZutSaYcK+ZXusdONNhHukeOugfd0KnviJHaFrsiuf07j2oNufuQKYdDrwUOTMTsf TJ6QiuV9dak3dVbpFfi23xyzbtdNZy63Lb5RDgp/xtFVbc48+wbTTnVGUQOiKUp/ONYa K/RQwQiXG6fPIbzf40S/DnYnKNAsq76YhNYWcwiw2z6b4Yg/PDE+MW2yEs0aEU3+T1+X TQIneSLxy5+Cxm5LGbDJKUrWUl1ZOz4y0nUNHRz4gE+Swo87wlSabq4ZQ/Sx/w3R0JNt Xa2w== 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=lao1+9rQNU2Vld3wP1vXdIipE1XCch/j4/THm7Go6bs=; b=YJE0SrrKuPj9JNTrRaODB7/lv9k0aBUHxcw0xAVybGbFHhjGaXY0jhno4+0CACy1O9 3z/cmwGrBA3vWG8kCKs+8Dr1+cGS/BPsdrLeSc50ASh//YFh0yzGP8C191xTMPqPHjMO pRXQpU7s/yQzX1ai3WjDSubOflAPvqg5sWo31AvK170RpNQ+GAdo2IADCcR1iesL8Q07 7SVP++Jc6wSvmClHr5ZK/rtZNOVYXckL0ZUi95gTM4lbaGwmZae8kTWlLCSYn9u2+iZa wlhk7PivQSh8DLv96XFy9fIA9WmtbAHnV4zKMA52yITP4JYCi7fg6EyHG9HftVJirRJz U8mg== 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 88si3158008edr.154.2020.07.01.00.24.51; Wed, 01 Jul 2020 00:25:15 -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 S1727847AbgGAHY2 (ORCPT + 99 others); Wed, 1 Jul 2020 03:24:28 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7326 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727981AbgGAHY2 (ORCPT ); Wed, 1 Jul 2020 03:24:28 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0F23C60AFAC84685FC63; Wed, 1 Jul 2020 15:21:42 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 1 Jul 2020 15:21:31 +0800 From: Yang Shen To: , CC: , , Subject: [Patch v2 4/9] crypto: hisilicon/qm - fix judgement of queue is full Date: Wed, 1 Jul 2020 15:19:50 +0800 Message-ID: <1593587995-7391-5-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593587995-7391-1-git-send-email-shenyang39@huawei.com> References: <1593587995-7391-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 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