Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1117981ybh; Thu, 23 Jul 2020 00:23:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvyqkMNuNnG8yi0KPvUoaKewjVTuWesLP4gi/liFr5Cmnz1z0WmayrmXrlgMTrJcQPJTFP X-Received: by 2002:a17:906:4158:: with SMTP id l24mr3044305ejk.101.1595489030144; Thu, 23 Jul 2020 00:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595489030; cv=none; d=google.com; s=arc-20160816; b=ez64uS7Ufw62qkkwz4lSYswmE1jZmt8TWSDo7EKP3cb4g8VQ8UK3VAnqvpTGJ/58OP VKVwzbU1BglKuKBxzERd0SftT5TTm2JhV6jQs9NbvRiuiXOEABNVE6eBWhA3+DzehJuY Ovvo2ATM3XRBzqubENbwFRcXoEiF4Zm6Q4Hm9LGE+Bsz1sisurxcF1yVa1e24+ARGHZT i/lDiBhnh0SJUUqtavV+cMm32qusJ2NVGdC7r6ELUOJ2de9iCJP21hcvX8aSfbUreyjV PqAFhnxdYyaEK9mv6y8M1iBnJn7CqaCwa6UvgmkK+KKZFxDvP/yDJi4dCGXIqR0KCwAz 9BJQ== 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=0KBtjbjmsK4JA4gBS8wldJERE7/y44eKczYquOUhI04gwXat0kmyYLQz3q3tiK5V+y dgyNrt2IzDO6Xg1RQnBdIHtbJy3hZ39L3xVu5K57kV6Y7X8PswsccavbcRxqXbg5A8jW MFy/pCUfzrNhm9wiW1XwsYWWl6fm+zQOn1IrsXM+nzFfXPMN9XES9Vl5I/m5gGpX3WIG YYnI1+NXS/MfVUMBFOTASLt6mkuMwcJXJOrG7qCXLcRJeqbvEuvyEUdugvkHWyz1A7jc Um+LxscXzBMK85FFNrHDdNcMjn/UQGeG67oKCj2KeKTGG14mecJL2zWEdg6F7Jo1PYMr QFuw== 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 j13si1432909eds.407.2020.07.23.00.23.27; Thu, 23 Jul 2020 00:23:50 -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 S1726964AbgGWHWA (ORCPT + 99 others); Thu, 23 Jul 2020 03:22:00 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8359 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726833AbgGWHV6 (ORCPT ); Thu, 23 Jul 2020 03:21:58 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1522CB5ADED9C007A61B; Thu, 23 Jul 2020 15:21:52 +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; Thu, 23 Jul 2020 15:21:42 +0800 From: Yang Shen To: , CC: , , Subject: [PATCH v3 02/10] crypto: hisilicon/qm - clear used reference count when start qp Date: Thu, 23 Jul 2020 15:19:32 +0800 Message-ID: <1595488780-22085-3-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595488780-22085-1-git-send-email-shenyang39@huawei.com> References: <1595488780-22085-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