Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5150651rdb; Tue, 12 Dec 2023 23:31:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHICKBK/eJUjqjo/tljet22XxHNrUOCGvmtZvFF4EMs+pYCgl44bEgebzYuru864J0awjC4 X-Received: by 2002:a05:620a:1205:b0:77f:2dcc:4f8d with SMTP id u5-20020a05620a120500b0077f2dcc4f8dmr8360079qkj.48.1702452701430; Tue, 12 Dec 2023 23:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702452701; cv=none; d=google.com; s=arc-20160816; b=eC+Lq9mkeiGClEvZT7YApvBJbzEV7Cvy5CXrcuGROHXoSSj7CZRxYI/WXAADU+iR+A heFs/KhX+EecvLNKDSN+glTiUWG9V2MfxbJRXoPKHp6mXfFWnrjei+65nnfdNseaWefp gfRQq/0A5jdAjqYy1jEzIHbYQevN1yHF3Ss7P/+Uh9aZlES1fXSdVbiUUaKPEO7iChAi JPDv9odzZ51w43cYe6Ohzq8tag6kbTSBlds6hjyZUh2iQxKHIT8m5Ua8xy5PfdVkwUal VUUVilYTzEuQRMPvnWnvGijqH7hDAYjCIP2NxaRutzvrcSljPWLenUQxsbUzFueq6+DT MmPQ== 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=P220VcY/Z0DwWKOXoVx7Fl785OVCqyfVCh0hgEzJwg0=; fh=ZhKmWNaA1fLVRun7BdmzkMlmFvxvFCrcNSIY0T/KKNk=; b=FMuGZQtcXpIchA4wMmIAdu1dtzZ5RLaU8aqu3Hs/DZnNTZ9DJgbrf5TZf9rmWmY923 PGK1Zw/DhAfBdw3KOWw7Gt2+wMNBz7jcQ6sP6EVNov72VZwA/CAewA/z5/hBtwsg3LDQ jlAydjXg3KaGeTd1zdDUR7nlqTwO7OCpYXTnernKc4SrgJszEfMzRnzEdWMoHvs66JgK NWS/uCFdCxoDaCGCFQhgcT540HoeIH7roaOtJbiQ3VV8dk+8tucezxJgRdbC+fslpR/f U0mNGCgUKKaLbaqphoX230YPkNL8qcD25IArxiOMCGjprQGC5u8T5FOgHzZZ/kC61/Wk V5kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=X2dsQ1sT; spf=pass (google.com: domain of linux-crypto+bounces-784-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-784-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 f2-20020a05620a280200b0077f6cd3d5f8si3487456qkp.114.2023.12.12.23.31.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 23:31:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-784-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=X2dsQ1sT; spf=pass (google.com: domain of linux-crypto+bounces-784-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-784-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 32EA51C210BD for ; Wed, 13 Dec 2023 07:31:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B81FE1C6B0; Wed, 13 Dec 2023 07:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="X2dsQ1sT" 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 4DD90D3; Tue, 12 Dec 2023 23:31:28 -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 3BD3Y1Y8012763; Tue, 12 Dec 2023 23:31:22 -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=P220VcY/Z0DwWKOXoVx7Fl785OVCqyfVCh0hgEzJwg0=; b=X2d sQ1sTLAKSsZ67AEDWT5fRGufGM732dNXsej86ZJYnynRnURod6UARTcO1EO72dLP ggBqy7yz7SgrJiazQ2wSPUM4dyxV8ZcSNLa9MB2iLJBKBYxB8IF5zc7kSZdr5hui 2gSbKvADOJBg8Ge9z/BsEzYMHR2u4S7VQ4HDdMFCmyBMmysd95nlfRNwH1RAyg1K Q1nozO5susqRQngzcenJsERtj2nnz2QPEuFlLUhYt4ajwFqniXDuGr2vzsS0k12F +5JW37El2odJ0PceXf6GqKJeks3olH0pBY3IYOsuIqAbH3Q2uzAhTQ+5dHdlpN+h 5nt2ipLyI68DB9YAnNA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uy4tggqyq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 23:31:22 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 12 Dec 2023 23:31:20 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 12 Dec 2023 23:31:20 -0800 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 712843F70A1; Tue, 12 Dec 2023 23:31:16 -0800 (PST) From: Srujana Challa To: , CC: , , , , , , , , , , , , Subject: [PATCH v3 4/9] crypto: octeontx2: remove errata workaround for CN10KB or CN10KA B0 chip. Date: Wed, 13 Dec 2023 13:00:50 +0530 Message-ID: <20231213073055.588530-5-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231213073055.588530-1-schalla@marvell.com> References: <20231213073055.588530-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: -AJkwnewLwAfU-G1cL08c1jWqh15qk6W X-Proofpoint-GUID: -AJkwnewLwAfU-G1cL08c1jWqh15qk6W 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 | 7 +++++++ drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h index 746b049c6c44..ba1682a213e3 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h +++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h @@ -186,6 +186,13 @@ 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_sgv2(struct pci_dev *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