Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp760112pxb; Tue, 5 Apr 2022 22:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlr+vWHgl28VF0XNOpUD79aAW5/Hw93d0vces1dYkqo16Zy0keElMIF//mWVFYAmah3d/7 X-Received: by 2002:a17:902:b10e:b0:156:1bf8:bf26 with SMTP id q14-20020a170902b10e00b001561bf8bf26mr6890565plr.8.1649221651582; Tue, 05 Apr 2022 22:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649221651; cv=none; d=google.com; s=arc-20160816; b=wMke0+YDszTK3+o8j+VJG3E2S+kSKaa2enz5CtjElRpoCmHKTf+yGZlqw+YoRkTvxk R4aMqfXl2mm+2SBT5ecDiaHj8ieqG4cs/44FccTJzGifxNL4zoW+az7GiHECpqWZYLAs xmxhon1ElmhrOlQaYnbYSnYDY8x0mK5xKZvRnkUeJm79a98n7IajaICoGsG9+ps0oMf2 aA4w39wzdzjQ6xfz00FtzadHCT5cd2rYdAwNbIlj6IJAiY/81fQP4Xkh3gvNDQznceap MFwm4wnVz0i4xHkQwM7Qyk/H9WSrOhDii1kBRa2uBEo3y9Ujsvbf5f9xWF2aFV7IFrtn fr5Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p1HO56+FY+8mkckM9TtHxbP9JRtB//EZZngkrETgKbg=; b=cspxIVJbBCi8BcUBOGuufk0tKj9uBKgTAPyQZ78KcKItGX5wG/I/5ST7frgK4/NG23 OiF61Z1UhZX5ZilQmPNHPmxszysR6T+W55DhU9kr86N/g98P6M2NdDWCXnjBXWMQJdsq zfXcKNmkAV+n4W+R0/Og2MUAp6wICc8T+sTKRHkQOKqrwibXm0Ptww0UnAVVx63eJUHn HjisgfDCVE7892xBBMvaPN34zBsAbOBGQbgTbqKJhU7b+q0I7I6utZKf1wn9yJkNDHA9 cTdgBhD15bAkDbbdPFPguSqf4kIS7KhIEXq1VzuriKYU5vexN0ttgA6QfqqfLmnU1fAy OrnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="x/37nQwq"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k20-20020a17090aaa1400b001c680fd1581si3983360pjq.97.2022.04.05.22.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:07:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="x/37nQwq"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD1B74249F; Tue, 5 Apr 2022 20:30:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350710AbiDEJ7c (ORCPT + 99 others); Tue, 5 Apr 2022 05:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239992AbiDEIWJ (ORCPT ); Tue, 5 Apr 2022 04:22:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E213A1035; Tue, 5 Apr 2022 01:19:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A624609AD; Tue, 5 Apr 2022 08:19:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E9C2C385A0; Tue, 5 Apr 2022 08:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146772; bh=KL2U+DdtwFetDLdywa1BvKB0ub14yiL29O6JG2SZpkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x/37nQwq60mxVYUfB+WklXeNKt4u1JVgaMznoT7NoYdWI61B2aw/ehjS8iK4SZHIX X8ZzTscGfQNFelJPQIDD3LFgyds85TuBlNOYr758VDKHAWGBkHQVksdxmWMfBClFdS EtADm2pR+K4NpgeWevmGBbYypPzAdxYkh2JmK+zU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai Ye , Herbert Xu , Sasha Levin Subject: [PATCH 5.17 0845/1126] crypto: hisilicon/sec - not need to enable sm4 extra mode at HW V3 Date: Tue, 5 Apr 2022 09:26:32 +0200 Message-Id: <20220405070432.353566176@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org From: Kai Ye [ Upstream commit f8a2652826444d13181061840b96a5d975d5b6c6 ] It is not need to enable sm4 extra mode in at HW V3. Here is fix it. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/hisilicon/sec2/sec_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index 26d3ab1d308b..89d4cc767d36 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -443,9 +443,11 @@ static int sec_engine_init(struct hisi_qm *qm) writel(SEC_SAA_ENABLE, qm->io_base + SEC_SAA_EN_REG); - /* Enable sm4 extra mode, as ctr/ecb */ - writel_relaxed(SEC_BD_ERR_CHK_EN0, - qm->io_base + SEC_BD_ERR_CHK_EN_REG0); + /* HW V2 enable sm4 extra mode, as ctr/ecb */ + if (qm->ver < QM_HW_V3) + writel_relaxed(SEC_BD_ERR_CHK_EN0, + qm->io_base + SEC_BD_ERR_CHK_EN_REG0); + /* Enable sm4 xts mode multiple iv */ writel_relaxed(SEC_BD_ERR_CHK_EN1, qm->io_base + SEC_BD_ERR_CHK_EN_REG1); -- 2.34.1