Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1020096rdg; Fri, 11 Aug 2023 07:23:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgYJDHb6dUqiiQIes05CAI2FswqYET9WxKhRvnIxHyAyvwgsqY8aMPNu4ewk90HJQansi+ X-Received: by 2002:a17:907:780d:b0:99b:de7b:7d2a with SMTP id la13-20020a170907780d00b0099bde7b7d2amr1851380ejc.67.1691763839285; Fri, 11 Aug 2023 07:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691763839; cv=none; d=google.com; s=arc-20160816; b=Rgn1Xt2dO0TduzKPx9Y6q2ar6fwwFcJM8sJyYuN+T0cWIUy2JHHuqUmV97VLLhSegv tKa1QMFjhTkS59fh/O0egd/+lMunF0v2i1klIJqEg9dX5fcPICWSoQWhy8Gk8kJXlqMN XyjsxBPfS9BO3T1W/vnPh+xzO/e7e5GFkUOmwiqcDY25qVmidO65sKmtEJf8FzmrOiKO 5boZpJ6jBEYsb0ekSI8r1wgaBeJlpvpsR4DSv+W60FdrjA4pzo35kWe+Fm3l25x+0F0w b5UpJfCPBp7lD1RpTkJmEAQkV4FhX4ixvizNQzBuEGymjo6Y6zjP6jygF24W+ImAjrrv 3usw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SuagU3ij38c2C8WbSaBbnwGNmYHZS3ZM8acJMHYVPYY=; fh=fXxcka4ttcRjf8y/QNeUVBVR3n8KtaOL7ehuC2YQY+g=; b=eFXSg4hJzK+ECtl8siLlwDU0AxAdYJva7rM4DzeqYMkPqV8hNY1ZeABER/nxYbFCit jGyliy9hPjkxs/jXSTqkRbxiAHHL1c/kO42w5mbRwWllggGJPiytV8f5WqSoJRI+Cat3 IxC4md/oSo+csDXkIuigp87P8cVR/efTnkpvUc7mUpWMmae3wYhOfIfrOqU6fAzYXMXn F+T/PlrcBW5Os400tjjpL6BUGNBhkgy0p6sCog3COfw27HlB/340rvYRsYHXTqXx44Df FSYPKrynnes+IwFnSlIJA6hje7n8dzJGygG2JrwxHmCf/SWfH7hopy5fbIqakDo0q/pR g9fQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a17090691d300b00992bfd1ffc2si3353280ejx.981.2023.08.11.07.23.34; Fri, 11 Aug 2023 07:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjHKOKy (ORCPT + 99 others); Fri, 11 Aug 2023 10:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234788AbjHKOKw (ORCPT ); Fri, 11 Aug 2023 10:10:52 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 946112709 for ; Fri, 11 Aug 2023 07:10:51 -0700 (PDT) Received: from kwepemm600009.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RMlzM2kgWz1GDDq for ; Fri, 11 Aug 2023 22:09:35 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 11 Aug 2023 22:10:48 +0800 From: Weili Qian To: CC: , , , Weili Qian Subject: [PATCH v2 6/7] crypto: hisilicon/qm - fix the type value of aeq Date: Fri, 11 Aug 2023 22:07:48 +0800 Message-ID: <20230811140749.5202-7-qianweili@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230811140749.5202-1-qianweili@huawei.com> References: <20230811140749.5202-1-qianweili@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The type of aeq has only 17 to 20 bits, but 17 to 31 bits are read in function qm_aeq_thread(), fix it. Signed-off-by: Weili Qian --- drivers/crypto/hisilicon/qm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index c9ed30b181bb..a1539974f95a 100755 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -73,6 +73,7 @@ #define QM_AEQE_PHASE(aeqe) ((le32_to_cpu((aeqe)->dw0) >> 16) & 0x1) #define QM_AEQE_TYPE_SHIFT 17 +#define QM_AEQE_TYPE_MASK 0xf #define QM_AEQE_CQN_MASK GENMASK(15, 0) #define QM_CQ_OVERFLOW 0 #define QM_EQ_OVERFLOW 1 @@ -1137,7 +1138,8 @@ static irqreturn_t qm_aeq_thread(int irq, void *data) u32 type, qp_id; while (QM_AEQE_PHASE(aeqe) == qm->status.aeqc_phase) { - type = le32_to_cpu(aeqe->dw0) >> QM_AEQE_TYPE_SHIFT; + type = (le32_to_cpu(aeqe->dw0) >> QM_AEQE_TYPE_SHIFT) & + QM_AEQE_TYPE_MASK; qp_id = le32_to_cpu(aeqe->dw0) & QM_AEQE_CQN_MASK; switch (type) { -- 2.33.0