Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4428810rdb; Mon, 11 Dec 2023 21:18:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEW2BDaI1siFrrtSCJyMSPO9DDuuSTTZ5j6Y/bm+TnqZt4X6Q6FoFOXu5XAfUC/5++njsTd X-Received: by 2002:ad4:42ae:0:b0:67a:d2ae:c2e5 with SMTP id e14-20020ad442ae000000b0067ad2aec2e5mr8321413qvr.10.1702358324984; Mon, 11 Dec 2023 21:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702358324; cv=none; d=google.com; s=arc-20160816; b=VcHXuN/6zCDKcVkOYBfd/GnIHWOgn5WOwObk5IlOBKmuDIEMzacicZSawOTiAnJlAe 9Zx36cluqtGY1YOELuPtDhEt/hLpwq4iT73JH2zpr5PUJ4jiyebWY5IdotnOWPwX5X77 Pg7gZK7OFCj+LHgq8Suc5V9divnLR6iH6L5WT4XRda5OnG3uOMs2kljBJfWwS1rA4QOG UIwDB61/ZwW4OF01ADmKljYfto7zZDMaUpYLn4Yozv0PN2JaZEBG6YaDyYeSgcj6gmDN xz2Pc4DjfUepkiMG45Na8q5640BSDT9aMoT2YZCKPbWMEfz/+cTpXREmApGujuEcYa+4 vmyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yiHOE6AG6cXnK0ODKTTevs5ZzYarbHn5mJbO+051JSY=; fh=ifa0Xq68mD109Gz0khd8ZOjXcbb8KEEjKiA/wXcE9P8=; b=g7M4/y+k/omZo+fO9Z8ZUwrT0Km1Mj7IcNBn5iKGz6JmLdpiHrgCz6n86SeGa6rDfw 5HYgCJUI8uL5svS4al1K5Zcm1EM91FbITL73L4tpXz9Ln7lGwUMH0vbC84icwngvhexN mNLrWoJRV9nZ63RgmzG83Lw2Zxs48lsCN6ICCj8uM3I8Le+7+luV96ytMLp6R6Z8bSRT QsnYBZpCJFvt8H+ewMnGjtTM5uT2dsdUkAuJKr1NlRcW3SViZ4XvMJKRH5N9Y2XK4bHI qW3bNLBubJwzRihdNyaIebLlRYeUviF1xzgC6baqneTGS8hAeNP+0vozXzePyORpZW25 dKHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jrqVggVM; spf=pass (google.com: domain of linux-crypto+bounces-727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c17-20020a0cfb11000000b0067a9d060d89si9958603qvp.141.2023.12.11.21.18.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 21:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jrqVggVM; spf=pass (google.com: domain of linux-crypto+bounces-727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B8AA1C21AC7 for ; Tue, 12 Dec 2023 05:18:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 716E914F8E; Tue, 12 Dec 2023 05:18:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="jrqVggVM" X-Original-To: linux-crypto@vger.kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D0B5CE; Mon, 11 Dec 2023 21:18:18 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BBK7Q4i009898; Mon, 11 Dec 2023 21:18:09 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=yiHOE6AG6cXnK0ODKTTevs5ZzYarbHn5mJbO+051JSY=; b=jrq VggVMZpD2OBHvJBtzlKS4RWgePL1Paggf5Eh+G5wLV3xy/A/INkkTynZa3yM8dgu YI7ocqcbbvS68YbV+AkW3Rjlfl+bSYE2LkfJ+0sJwASg+xXWyBprIXCwSG2mUN2H jkIL5bW/JlhUrunkr1Q8dj95rNjarRMn9JD3nOXFc5vXpz428KBOKGXDglYHpf6b 8yMoQAYPybuOM3+XuLlpQ877YABWLYpKaY5vjjl1R8IS7friZK2lRSSCgdcMg/+0 /AnfYZTgOEEWJK3LW46Swp7f4cNwxbjvXhL3b5KbNFUzct+LgP3narzQtj7m0nOr qVOpScUwHEjfikkcXag== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uwyp4kp70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 11 Dec 2023 21:18:09 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 11 Dec 2023 21:18:08 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 11 Dec 2023 21:18:07 -0800 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 73E593F70A2; Mon, 11 Dec 2023 21:18:02 -0800 (PST) From: Srujana Challa To: , , CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next v2 05/10] crypto: octeontx2: remove errata workaround for CN10KB or CN10KA B0 chip. Date: Tue, 12 Dec 2023 10:47:25 +0530 Message-ID: <20231212051730.386088-6-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231212051730.386088-1-schalla@marvell.com> References: <20231212051730.386088-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: lWh1mlaDlhhSFYseZp56lFLLYmXt3i2x X-Proofpoint-GUID: lWh1mlaDlhhSFYseZp56lFLLYmXt3i2x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 Adds code to not execute CPT errata "when CPT_AF_DIAG[FLT_DIS] = 0 and a CPT engine access to LLC/DRAM encounters a fault/poison, a rare case may result in unpredictable data being delivered to a CPT engine" workaround on CN10KA B0/CN10KB HW as it is fixed on these chips. Signed-off-by: Srujana Challa --- drivers/crypto/marvell/octeontx2/otx2_cpt_common.h | 8 ++++++++ drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h index df7321193f19..f932a3bf3e3b 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h +++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h @@ -186,6 +186,14 @@ static inline void otx2_cpt_set_hw_caps(struct pci_dev *pdev, } } +static inline bool cpt_is_errata_38550_exists(struct pci_dev *pdev) +{ + if (is_dev_otx2(pdev) || is_dev_cn10ka_ax(pdev)) + return true; + + return false; +} + static inline bool cpt_feature_rxc_icb_cnt(struct pci_dev *pdev) { if (!is_dev_otx2(pdev) && !is_dev_cn10ka_ax(pdev)) diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c index 7fccc348f66e..e319aa1ff119 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c @@ -1254,10 +1254,12 @@ int otx2_cpt_create_eng_grps(struct otx2_cptpf_dev *cptpf, * encounters a fault/poison, a rare case may result in * unpredictable data being delivered to a CPT engine. */ - otx2_cpt_read_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG, ®_val, - BLKADDR_CPT0); - otx2_cpt_write_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG, - reg_val | BIT_ULL(24), BLKADDR_CPT0); + if (cpt_is_errata_38550_exists(pdev)) { + otx2_cpt_read_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG, + ®_val, BLKADDR_CPT0); + otx2_cpt_write_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG, + reg_val | BIT_ULL(24), BLKADDR_CPT0); + } mutex_unlock(&eng_grps->lock); return 0; -- 2.25.1