Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1503232pxa; Sun, 16 Aug 2020 00:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuW496pzP31xFrpcZ8LyrLdKlbiQFf1G7KuNAbFWW+kazzwttP8fuH6nEVqYO5nZpv+v8T X-Received: by 2002:a17:906:2f07:: with SMTP id v7mr10266718eji.313.1597562676257; Sun, 16 Aug 2020 00:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597562676; cv=none; d=google.com; s=arc-20160816; b=igF/mmJGHURSgQbT+gg9KLltrtoJfGKgr61Sn04gMnB8wOPiaLd28nRLWzVX/hDQqJ +mV1weR+8tWG1R/NizYxqzcSx5EdfMf0VIOXY6iFsPK/P4VBnNwvcaxZ/3ksjBSiMeyT uDvn2ZD3IHBqzw5TixaUEXeAA40ubELrgiBGlmr4jeB2gKzuFElRww9u5/foaN/NzfPr TmnMpDjeS+jE0boF1UwZQyi3kr7QviGGSxSmrFCbJ8Tapu7sXNs6XgXAsy+ZKDlT+4Vj HbSVFjM8pdSkrZMM63QzO114bCTThERXcQ8D1KQbxDNf+0UMEFG2iWmDtvcJ15SYEcs6 wMjw== 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=1kMw7GfOmH/eHerhkxImwEPuAwyjfJvyhNNScQzyltg=; b=FFTnLYTjYNiJL83c6/Ldh/Sl1MwiTuBPy3awrx6U/9hg6jVF6U7xYdGz9uJB7SFx4A ScNOMx0nXPEytvv0+Tn+gwP9DHr2QHcqi+ZEFu3qW8KYjadMC31NMquRzhCj0cMzi0QF qsnl2Wf32Xx1dUccNX++2k7C/4h90UNii6D/bD9bsvmZNj5WzQR6bZcJXI9gXpT7N+sJ M2EDuWGBe6gs4MLlRg7hbWx8EDfJXcVA6WHkHymxOFxiInhXse3mhG2GmID6g1dYeY/Q jBPBDTXhqw0v+b/clw9Ksie7pMloLT/nJjwUcakKyROXTd1y8MMTEUSE8U68fOrekjDO loyg== 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 dm7si9086442edb.342.2020.08.16.00.24.13; Sun, 16 Aug 2020 00:24:36 -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 S1728774AbgHPBoP (ORCPT + 99 others); Sat, 15 Aug 2020 21:44:15 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33806 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728904AbgHPBoP (ORCPT ); Sat, 15 Aug 2020 21:44:15 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 176E8BC784FE91B3C3E4; Sat, 15 Aug 2020 17:58:34 +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:23 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH v5 02/10] crypto: hisilicon/qm - clear used reference count when start qp Date: Sat, 15 Aug 2020 17:56:09 +0800 Message-ID: <1597485377-2678-3-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: Shukun Tan The used reference count is used for counting the number of 'sqe' which is under processing. This reference count should be cleared as starting 'qp', otherwise the 'used' will be messy when allocating this 'qp' again. Fixes: 5308f6600a39("crypto: hisilicon - QM memory management...") Signed-off-by: Shukun Tan Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/qm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index fb389c0..1e49931 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -755,6 +755,7 @@ static void qm_init_qp_status(struct hisi_qp *qp) qp_status->cq_head = 0; qp_status->cqc_phase = true; atomic_set(&qp_status->flags, 0); + atomic_set(&qp_status->used, 0); } static void qm_vft_data_cfg(struct hisi_qm *qm, enum vft_type type, u32 base, -- 2.7.4