Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp629925pxb; Tue, 5 Apr 2022 16:33:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBM/j5F8wWJ0KW4TsOAoWst6hYVruQrQm34lasBJpdGwa1RNRWcQEnxM3/r9Jv9fHyQV4X X-Received: by 2002:a17:902:f682:b0:154:8500:80bf with SMTP id l2-20020a170902f68200b00154850080bfmr5779601plg.112.1649201609256; Tue, 05 Apr 2022 16:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649201609; cv=none; d=google.com; s=arc-20160816; b=jqnJJn26aYTy36LNhXZyhnZWd3O8Rosh/KCJf3dXqQK0rsfsolnjCQ/LoLcSGyZQL9 oMzIcUCAObFpc6o/R5c6i7y8ZfZIb2CZL7cbMoWKFliRVnBTZiL0h55MAuoXQV42FAOf kQIBxnmsdYxvbgVXErgFVI0dUEJ/XW4foOne678EXhf5Z0eUlLyEtlm3oo/z11YaYbYh bIgWcUwP2vrhTtFXCxU92NUC0ukuX/6TsD/y7mpL8J9fSb43sHdaxS+xpBd0XiZBJhq2 BVkEv/t0IZ7IXWCAMolrxRK83r7HiCWBqPle6J+eYoufV6MTYp0QWlabC+RuwZqDyt/U eGQw== 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=DneuT4iWXKVFcXmuFYoPlxvp0ChbWr3xbnHfFXmk+cc=; b=AB3B02Lh3dXZj8z5V374ZUudctENhdWsHcT5ClccpJquTgpF9DNgCGpoDmuFCpK7/W noNtnElHKyeS6oZ9uoO6FAI8tu3cQq2nuY9AiSPeRA/Oer3L6fsqg7pNic9GBk78dZlJ TNwvA/LNwCfYrl4MZWfEY5wjOiZhDxysFTjCK2chi1QCOK5FoB2KZQlJKWrIJUbP8yNa teWh9ybhD+KdiM3PKy9HTewf2PE3+DfHhFyudbKCOeB1LSDrxB3j6EM4BFwbsA0dj22p kfsb6C5MO9S6v/RVl6qDqtaykZVzN4aGo8ByjI5jUpmKnR3JfzZ+0fveFgJ1aL0pkF9O LQdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l+zQD2h5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t31-20020a63535f000000b003816043f0c7si13479035pgl.700.2022.04.05.16.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:33:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l+zQD2h5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 6DF7170F5D; Tue, 5 Apr 2022 16:17:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387211AbiDENOx (ORCPT + 99 others); Tue, 5 Apr 2022 09:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344239AbiDEJSz (ORCPT ); Tue, 5 Apr 2022 05:18:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F9349266; Tue, 5 Apr 2022 02:06:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8F8D6B81BBF; Tue, 5 Apr 2022 09:06:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFEF2C385A5; Tue, 5 Apr 2022 09:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149566; bh=4iVXIPkT3ePxCznX2ZMKrI8so8HKS+0aauaqn24SB9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+zQD2h5kYgWVs9fqIC1UriKd5ZtwHYYqcjnD2auAbERw2oyVtUWi1rBcr24VgqNL EjncbdkYKtB5EtvO5B1/lIB5z02J/IQAazXvsIvBU6KpT3GB3Rqx71xIkIs6WUOjfM 5m7QMAB2YX7yrkrLRRRI2ayMpvOkmK1EffDl+iAk= 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.16 0762/1017] crypto: hisilicon/sec - not need to enable sm4 extra mode at HW V3 Date: Tue, 5 Apr 2022 09:27:55 +0200 Message-Id: <20220405070416.877684130@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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 90551bf38b52..03d239cfdf8c 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