Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1167825rdh; Fri, 24 Nov 2023 06:39:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmFQsFiwCHgVnDIcp9JUwXkP8Ge8cgRR32ibS0SO3vBvg4qd1QnvxTzFqcx7N3xEIcc76K X-Received: by 2002:a17:90b:80b:b0:285:866f:ca0d with SMTP id bk11-20020a17090b080b00b00285866fca0dmr2690792pjb.46.1700836754068; Fri, 24 Nov 2023 06:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700836754; cv=none; d=google.com; s=arc-20160816; b=q7OJa4nHBKSZ4NvMGbUnWNrRkIuEmC98CKcwr39cc27eUr36VkZeTxZQu2UagpxFgy +QgeHvloHCZDKPZA852dA8pgvJxBotOyCA/CZDbO2ndmsIipA50LA9DfOYfU6t5hhAya WZnQ2zUTo3izKGpSlhTnRKP0ZG+c0PBMp3AG9hWZEzGfuG5PCzwDzvaVDjsH1mG4gJmd TXJ6jxmhVPVNCLroDuVFJqcu2LgKH9ptuUx531kXgcFKIwdIlT6kf6TZdmaUnq1UJbxT mg76lbyjXlBQMByjEIf2DENfsV2GFQKW6riJZrmAoENJ+YroE0SxyOH/ocXf2qNKLmlB IfOg== 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=o9tw8oKk3uqh1RfckyJZQ1ro7WWsevdcNFajSb4vzkU=; fh=L3ExVjLjkuIeV+5cgHIxxatCcy3G7VuNWaIBOLRwqV4=; b=rjbBCyav0JbWF80M82YNLf9nR5D7NZJqkR0lN3vUZosEOOrn5qIzJbaQRnAFt2iYRw mD14DRhkYxmRe15DCfbdg5T+ktDsEjtDXJw+1XMjLiJN5a4LsdPRBixYdi4GEaP+m8Nr 961cbrkWXI6iW1m8BojVhnqjZMM5puso0BD7ZRcgMOiLTzvLsxnJqN9a++rCMVxBIjo9 6WjNhRYky5Kl94UhXhGOiBgxYc6RzvA1qGg5OIaPCvP62lyAB2pB2oCHprlTx5s5yFd6 duArtFFVlFjzZAG0BlQdhwK8WbiJd8PXaUZZirXCn6ef1dV1gG7ghfHNJu5sxscg9+sp j+XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jPg8ekCo; spf=pass (google.com: domain of linux-crypto+bounces-268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fr21-20020a17090ae2d500b002839b4b17a9si4149473pjb.97.2023.11.24.06.39.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 06:39:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jPg8ekCo; spf=pass (google.com: domain of linux-crypto+bounces-268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-268-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1B2B7B2184B for ; Fri, 24 Nov 2023 14:39:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FC432D7AA for ; Fri, 24 Nov 2023 14:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="jPg8ekCo" 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 AA0B4D71; Fri, 24 Nov 2023 04:51:30 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AO5QDBo021287; Fri, 24 Nov 2023 04:51:23 -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=o9tw8oKk3uqh1RfckyJZQ1ro7WWsevdcNFajSb4vzkU=; b=jPg8ekCoAlswOQV7dOa3sKahYPueIAmuapz/t2mb3/MRpcE/UfGCxuL5wtRZ68ESM9c7 xi1bnyYoKSQzWQRyLEbUmyhrQHys/XAgkO2uglrHrOZdlK+CFHUF/o1/R4fiysdRgHAZ JqVTxsVDBta5RnsUcL2v1lnU1rW/RGPl3xYGlmPrr196tTRb2x9o9Suwdoy/TEKbN5s9 C8TSqI3yx9TOCTR6QI3k5Y277i3yDT6tPXWq0oyN+8Red3CjpF5rDl/pgX3H91Xj3ecJ 1J1fsPXHOYyGqoiryqyWyDcnEF8SSa1q7glFGCF11bQ+Ratbxu3mHYa/wP8XwEVOKEiO 7A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uj7yku07q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 24 Nov 2023 04:51:22 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 24 Nov 2023 04:51:21 -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; Fri, 24 Nov 2023 04:51:21 -0800 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 436833F708F; Fri, 24 Nov 2023 04:51:16 -0800 (PST) From: Srujana Challa To: , , CC: , , , , , , , , , , , , , , Subject: [PATCH net-next 05/10] crypto: octeontx2: remove errata workaround for CN10KB or CN10KA B0 chip. Date: Fri, 24 Nov 2023 18:20:42 +0530 Message-ID: <20231124125047.2329693-6-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231124125047.2329693-1-schalla@marvell.com> References: <20231124125047.2329693-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-GUID: EG00V_0V6z9Z9W4TQXQjliGheoiv5z22 X-Proofpoint-ORIG-GUID: EG00V_0V6z9Z9W4TQXQjliGheoiv5z22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-23_15,2023-11-22_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 bef78db15a89..4c5454470267 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h +++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h @@ -192,6 +192,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..7178fa81f00f 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