Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp343360pxa; Tue, 4 Aug 2020 07:03:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8kanM5Zq9gdbTI7KT4t45YNfu3ur4lVYOgXSjQfN6gkdlMWZe0Qf1gHhYUy+9YOxifYsi X-Received: by 2002:a50:d908:: with SMTP id t8mr20134716edj.373.1596549802529; Tue, 04 Aug 2020 07:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596549802; cv=none; d=google.com; s=arc-20160816; b=Ag28e3//QIP4SRyG1JjE2z0eiVnR1ZiHaVXhGWGzHA79mU4cKscgrqDkP08FdOH7OJ FlnDuoiU/Lrs9qwooPFGf8WoF3tBWb33vgZOJOhnFLFm0RY9YUzZfCUVLzinqdVqLh4D P+0I3FXcUYQZvlrWh5DgvxnDpfIC0gy6XTTuIXbWidkdoV25MD07XAE7fy9Cd6OHxQg+ 3NY0qTOi4mmx73AYorcB9B/6deNwLSV+3+cx98aZSaa9qrYrDTifKvvbmcesSX4/40mb oh9V7nvDh4USuZiq684i11+AjCCKNetLfDf4Y+apMJhe205DQgMF/F2PNP2kCDjeJrwZ CLrQ== 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=KCDKXGtyfCY0sd3ol740bKsElEXIPQyrv/0lxYWGACU=; b=cyVDwQg1fzhyZZpP1cosJ96QsUro6NijTlNn1lJ3wFLnLRFDcwQYmN1i4gFfCoaILS j56IfDLeCRQcr/IdFRL6av+I2KqSATJNfj7saAJjNQxByYGNpbQhKWdYQj5t52/XeSrR VEyIQZeFydMEC+M7o+UrWJcxkmIRcUd7vKogw7kPC1OLNO9NIQkwlJVhJqk57/QyMbz3 yiTRo64lDMexkKVGJJhHg6WB6l1vsmN7t/Q6QOflc//3OKkXlMZ1tHYwxJ1ezXwtFztD USIHJNKL/6wwi08qa9ApTCs4Enl+UwjKZkM+IwdrhnMdoDAP9ihribLMBbID2F+AqXUs H6eg== 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 y27si3268149ejc.439.2020.08.04.07.02.56; Tue, 04 Aug 2020 07:03:22 -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 S1728560AbgHDOAy (ORCPT + 99 others); Tue, 4 Aug 2020 10:00:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:60722 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728722AbgHDOAl (ORCPT ); Tue, 4 Aug 2020 10:00:41 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A78B34DB814B1AEAB362; Tue, 4 Aug 2020 22:00:38 +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; Tue, 4 Aug 2020 22:00:30 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH v4 02/10] crypto: hisilicon/qm - clear used reference count when start qp Date: Tue, 4 Aug 2020 21:58:22 +0800 Message-ID: <1596549510-2373-3-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596549510-2373-1-git-send-email-shenyang39@huawei.com> References: <1596549510-2373-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 ffb28cc..e89d9b6 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