Skip to content

Commit bb1548d

Browse files
committed
crypto: octeontx2 - remove errata workaround for CN10KB or CN10KA B0 chip.
JIRA: https://issues.redhat.com/browse/RHEL-31478 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 9d1d570 Author: Srujana Challa <schalla@marvell.com> Date: Wed Dec 13 13:00:50 2023 +0530 crypto: octeontx2 - remove errata workaround for CN10KB or CN10KA B0 chip. 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 <schalla@marvell.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
1 parent bbfd989 commit bb1548d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/crypto/marvell/octeontx2/otx2_cpt_common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ static inline void otx2_cpt_set_hw_caps(struct pci_dev *pdev,
186186
}
187187
}
188188

189+
static inline bool cpt_is_errata_38550_exists(struct pci_dev *pdev)
190+
{
191+
if (is_dev_otx2(pdev) || is_dev_cn10ka_ax(pdev))
192+
return true;
193+
194+
return false;
195+
}
189196

190197
static inline bool cpt_feature_sgv2(struct pci_dev *pdev)
191198
{

drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,10 +1254,12 @@ int otx2_cpt_create_eng_grps(struct otx2_cptpf_dev *cptpf,
12541254
* encounters a fault/poison, a rare case may result in
12551255
* unpredictable data being delivered to a CPT engine.
12561256
*/
1257-
otx2_cpt_read_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG, &reg_val,
1258-
BLKADDR_CPT0);
1259-
otx2_cpt_write_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG,
1260-
reg_val | BIT_ULL(24), BLKADDR_CPT0);
1257+
if (cpt_is_errata_38550_exists(pdev)) {
1258+
otx2_cpt_read_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG,
1259+
&reg_val, BLKADDR_CPT0);
1260+
otx2_cpt_write_af_reg(&cptpf->afpf_mbox, pdev, CPT_AF_DIAG,
1261+
reg_val | BIT_ULL(24), BLKADDR_CPT0);
1262+
}
12611263

12621264
mutex_unlock(&eng_grps->lock);
12631265
return 0;

0 commit comments

Comments
 (0)