Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2976807ybt; Mon, 29 Jun 2020 11:57:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6BKGe+3bXMMAjC8lKR7e4fMT6SR5LnCDvMgi5Kawfgl4MHD0ATRrD4vKS+zCjm9bnfqLW X-Received: by 2002:a17:906:384a:: with SMTP id w10mr15763593ejc.235.1593457055993; Mon, 29 Jun 2020 11:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457055; cv=none; d=google.com; s=arc-20160816; b=w4VOoY6SIjtD60QnKUEWQPgPGviMvbkQytczpsgfZGPGBIFL1Es8P0wxC/rZ0PXogM 6fpmQEFdfaFJpGdhIhSlcFCLNuZ+Hw205D3kFVjAICoGC2Pn3njtdbRNXJ3aCgvD1pnh Q8F6Ij4K5fNAn6bipsGTr90L722HunasWdcoNHapwKO00iLeHzV2J2M1dRLHaaji4pJg X9mxRwYvBXGzTv9Rla7QKnL5wl2LBzGFP7HGPRNB1a2Ug0sQ57uYexzUlwe440VArfO8 snBGScJKrSDSb63B6AIor5U0DWUsDRjm1rP1+YukgM3tdoeDFrI0lbWgc6ne3yAzqjy6 eoig== 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=UNbdGzmwXv1g1XgUVEQN4pN9whCZn3v5b0gqvuaH/o4=; b=kQiKXAncgMq4WuHtoJYW5rnK30ArkojC9Iv3CUAdOV+qN3S8S2PWG5aveLDEWrFjG8 ATzXdRq5UI7uVxo87KK17qVzt5GgMBrJmv/sIEbP/wOSJGtA/zwvqJoWiIna6szpist/ Yf8TG74e4zO7oDKN8gNkdfYHPMgHcD50R2oMO5FfI/vaTl5Cq8ofOI5doNg3eW4STE3R ioBDz4LP65gkcziVRZWIzWqwo6cHYtfGF+UFH0HmE+RVB3l+9xsLb0sGgt2TlnbknQEF Ep3EXUZbf7mkl4CfZBSVyGgfbz3a0KIcM1UOmjdgya5eKXMRRJ2YQEi5jwhLqa+aRgRO Kilw== 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 z16si296664ejw.386.2020.06.29.11.57.12; Mon, 29 Jun 2020 11:57:35 -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 S1729470AbgF2S5I (ORCPT + 99 others); Mon, 29 Jun 2020 14:57:08 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59520 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729810AbgF2S5E (ORCPT ); Mon, 29 Jun 2020 14:57:04 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2EF2D262C820835CE9CE; 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:44 +0800 From: Yang Shen To: , CC: , , Subject: [PATCH 2/9] crypto: hisilicon/qm - clear used reference count when start qp Date: Mon, 29 Jun 2020 19:09:01 +0800 Message-ID: <1593428948-64634-3-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: 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 --- 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 ad0adcc..79d17a0 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