Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp380104ybt; Wed, 1 Jul 2020 00:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOOZdRYlDGz514/AXPt4Fo3yu+9iiN9uNSIwH8zmHwzwZX5hp6DFUFzvdvj5Y56BTpRNuD X-Received: by 2002:aa7:c1d8:: with SMTP id d24mr27902498edp.178.1593588133440; Wed, 01 Jul 2020 00:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593588133; cv=none; d=google.com; s=arc-20160816; b=gL1Z06NZ0Vzu87L/bsjBLNd+fn+WkHaiqrsdoSSmHPjtZyi0KN1nzRB+9JqrR2hBfJ 65tIdlFKr9tqWZN4s6GCjX3GEr8u+hDhYbFcIXtKtg+5QsLYNNohvxysTqqNlirqgG58 6NaKaFZ3F6y3/msdMUEh2nuJkB6RHIs+4YtsPc73/xhNPBEVA8t0j1aQ4qICCrKoHGik yffEU95qEU9mYSzxrfwoc1ejrcO9shF0fYFfbGXn9/rQJpf8fMNMz20BNQ6CaLOx1q2b Bbin9oFxILwam9grG0LjLGtaKmsZKm194URyBsxfy7A+QJUSoHDEgvyo0JFpyjPUg99k wY+A== 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=GdzFw7avlCJi9EvdrBTjxTPH/zmwXX4ifPZ7tcnWOQA=; b=m7XotnP5hyEfkfGheO1/YnYVZwRnHogeiUIgNLxhhWJtLs4Ow+OebhZFG+OS/A3EGn /cVA7HPNBBQWVFUiA6ipYCT8EZBIG2w+GaF97I1iCEC2d/36zYxIO5dUN/jAWaOuZcax x7FIEThpiy+i0FfMM6fyPVIW3Ppp74gC8otNyleMBzUn9v2XYNU1juEAPECcuQBn21Ss i4BMlLw0Y9Ugm5F+qtnKPvGIoakFz22iVt1/OQbQbfXTTWg4MQ8XLlBBR38PutNn0BLh kpdM7SYizoO8LBvj7vGBNZNRsnxOgsrjdLgL8H49/F8fqEwCVkb3tebR6nYHABvHNZNY 3v8g== 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 u17si3071032edy.254.2020.07.01.00.21.50; Wed, 01 Jul 2020 00:22:13 -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 S1728113AbgGAHVo (ORCPT + 99 others); Wed, 1 Jul 2020 03:21:44 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57358 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728130AbgGAHVo (ORCPT ); Wed, 1 Jul 2020 03:21:44 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D4F888690169B6F11AF0; Wed, 1 Jul 2020 15:21:41 +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 2/9] crypto: hisilicon/qm - clear used reference count when start qp Date: Wed, 1 Jul 2020 15:19:48 +0800 Message-ID: <1593587995-7391-3-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: 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 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