Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3801589rdb; Sun, 10 Dec 2023 23:20:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYnRIqdmKpefFnUlQ3BbP12cUo9gF5yUqGTU8Cy4u+/jJRyb1rPGMaHR2SWesfL27fW5ve X-Received: by 2002:a05:620a:3844:b0:77d:a0a3:f830 with SMTP id po4-20020a05620a384400b0077da0a3f830mr4387568qkn.36.1702279222155; Sun, 10 Dec 2023 23:20:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702279222; cv=none; d=google.com; s=arc-20160816; b=CV9aOCgVJ3tNaiaSe9U/Ay2gvJkJbBJNr73lCTP33GzYUwk32G+rmEUe1WJJrxOOK6 scBBtDEnhOtczMBFChtg2rSd7B9jB77GF1xzucI8hjlcsv9tfpRLtnq6B/KnjB0Xasze URXuEnPUxACKKrJs+qszNe+LnTQI1KBK9n2wena8cCAb1rNXCsOxyHp9yGQqw1As8R2e XNRbvbhYZlrencWg1ifD8hFFHtTEA674us8wvF/Xq9a20GEn2Nnqj0Tk2REnBlU2T9b4 Bs+2aTsW43uLX33aNOz/91E0XsSWBNE3unrWox373mo53+rn+CPQUXN4wp+GshDSJeBO ZyTQ== 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=aRjwBcyQurjYx2gnRf/+QgF7bF7tu+amylWotPqEUL4=; fh=ifa0Xq68mD109Gz0khd8ZOjXcbb8KEEjKiA/wXcE9P8=; b=YZNx5p26I/wHSnXN1PtkDNDLxkjNrVETJCG70IYFR/mxtOV6WPzvyuqLn7usR8XnQs 8RmE1SravZbuMHbQHCxvFh4qY55NteBWSrdZy0JNCTCxsKF6rwzekxgVRu02oISrhkNa QH8ukRkTKF0XT8rvqb/pb5+lB3Uh97KqUd0zWuP1wUKp26rSHfcuGhbSTlZNliWffiVz A83OD/OWdMdzKtxzFFgFwuZF5iZ+nRn3HbSmf6qXpr9MBEReQ092rYbfstsqqft/ot7v ItMCC9bWwJhIHmnEn7bfAuxevHZ1EroN/Qt058lITT/2EGhbcZ0SQe0UcJNhfsKk6B/f bkIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=QRjp9Ell; spf=pass (google.com: domain of linux-crypto+bounces-684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-684-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 sq6-20020a05620a4ac600b0077d72f44c61si7259304qkn.754.2023.12.10.23.20.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 23:20:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-684-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=QRjp9Ell; spf=pass (google.com: domain of linux-crypto+bounces-684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-684-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 E4BB61C208EB for ; Mon, 11 Dec 2023 07:20:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B42772032F; Mon, 11 Dec 2023 07:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="QRjp9Ell" X-Original-To: linux-crypto@vger.kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D038E; Sun, 10 Dec 2023 23:20:03 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BAMh88S026392; Sun, 10 Dec 2023 23:19:53 -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=aRjwBcyQurjYx2gnRf/+QgF7bF7tu+amylWotPqEUL4=; b=QRj p9EllfW+lJugThxsD3CJ6goA2HovMbdPzIU70qYjUyNpgoxCAHv18HvO5TTp8ede /m6AvP/f76XXLK5/QZBr2Y2AkXynkhwYJQbTD6ttTL9hVf9AGlivZOsSNHxWjD91 WSPndQgcaXdjkHSrhWBYoIxz9boLluYf41uKs68aoTgHrTBgKFkh8BVW4h4wrxeI 1nIyafmtPkqljv+Vl2Yj3liFd2NNPP9bbcOZMn9shpTZ5VS5s5X2kz5+VOceqxKW /bgTVy7ctnq+vmyzQEBWCTewdx0aFUo0HJAXt61ym2m969rdThW7QEUlsR5brduh 0e5HAx6eMu32mmTR61w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uvrmjkmjh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 10 Dec 2023 23:19:53 -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; Sun, 10 Dec 2023 23:19:51 -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; Sun, 10 Dec 2023 23:19:51 -0800 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 73C643F7097; Sun, 10 Dec 2023 23:19:45 -0800 (PST) From: Srujana Challa To: , , CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next v1 05/10] crypto: octeontx2: remove errata workaround for CN10KB or CN10KA B0 chip. Date: Mon, 11 Dec 2023 12:49:08 +0530 Message-ID: <20231211071913.151225-6-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211071913.151225-1-schalla@marvell.com> References: <20231211071913.151225-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: VtU_8zHEHqwyCtlTICLOlizmIloqu8FC X-Proofpoint-ORIG-GUID: VtU_8zHEHqwyCtlTICLOlizmIloqu8FC 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 847f539cdd0e..568efac3d8a6 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..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