Skip to content

Commit 87751e7

Browse files
committed
Merge tag 'edac_urgent_for_v6.18_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fixes from Borislav Petkov: - In Versalnet, handle the reporting of non-standard hw errors whose information can come in more than one remote processor message. - Explicitly reenable ECC checking after a warm reset in Altera OCRAM as those registers are reset to default otherwise - Fix single-bit error injection in Altera EDAC to not inject errors directly in ECC RAM and thus lead to false double-bit errors due to same ECC RAM being in concurrent use * tag 'edac_urgent_for_v6.18_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/altera: Use INTTEST register for Ethernet and USB SBE injection EDAC/altera: Handle OCRAM ECC enable after warm reset EDAC/versalnet: Handle split messages for non-standard errors
2 parents f824272 + 281326b commit 87751e7

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

drivers/edac/altera_edac.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,10 +1184,22 @@ altr_check_ocram_deps_init(struct altr_edac_device_dev *device)
11841184
if (ret)
11851185
return ret;
11861186

1187-
/* Verify OCRAM has been initialized */
1187+
/*
1188+
* Verify that OCRAM has been initialized.
1189+
* During a warm reset, OCRAM contents are retained, but the control
1190+
* and status registers are reset to their default values. Therefore,
1191+
* ECC must be explicitly re-enabled in the control register.
1192+
* Error condition: if INITCOMPLETEA is clear and ECC_EN is already set.
1193+
*/
11881194
if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA,
1189-
(base + ALTR_A10_ECC_INITSTAT_OFST)))
1190-
return -ENODEV;
1195+
(base + ALTR_A10_ECC_INITSTAT_OFST))) {
1196+
if (!ecc_test_bits(ALTR_A10_ECC_EN,
1197+
(base + ALTR_A10_ECC_CTRL_OFST)))
1198+
ecc_set_bits(ALTR_A10_ECC_EN,
1199+
(base + ALTR_A10_ECC_CTRL_OFST));
1200+
else
1201+
return -ENODEV;
1202+
}
11911203

11921204
/* Enable IRQ on Single Bit Error */
11931205
writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));
@@ -1357,7 +1369,7 @@ static const struct edac_device_prv_data a10_enetecc_data = {
13571369
.ue_set_mask = ALTR_A10_ECC_TDERRA,
13581370
.set_err_ofst = ALTR_A10_ECC_INTTEST_OFST,
13591371
.ecc_irq_handler = altr_edac_a10_ecc_irq,
1360-
.inject_fops = &altr_edac_a10_device_inject2_fops,
1372+
.inject_fops = &altr_edac_a10_device_inject_fops,
13611373
};
13621374

13631375
#endif /* CONFIG_EDAC_ALTERA_ETHERNET */
@@ -1447,7 +1459,7 @@ static const struct edac_device_prv_data a10_usbecc_data = {
14471459
.ue_set_mask = ALTR_A10_ECC_TDERRA,
14481460
.set_err_ofst = ALTR_A10_ECC_INTTEST_OFST,
14491461
.ecc_irq_handler = altr_edac_a10_ecc_irq,
1450-
.inject_fops = &altr_edac_a10_device_inject2_fops,
1462+
.inject_fops = &altr_edac_a10_device_inject_fops,
14511463
};
14521464

14531465
#endif /* CONFIG_EDAC_ALTERA_USB */

drivers/edac/versalnet_edac.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -605,21 +605,23 @@ static int rpmsg_cb(struct rpmsg_device *rpdev, void *data,
605605
length = result[MSG_ERR_LENGTH];
606606
offset = result[MSG_ERR_OFFSET];
607607

608+
/*
609+
* The data can come in two stretches. Construct the regs from two
610+
* messages. The offset indicates the offset from which the data is to
611+
* be taken.
612+
*/
613+
for (i = 0 ; i < length; i++) {
614+
k = offset + i;
615+
j = ERROR_DATA + i;
616+
mc_priv->regs[k] = result[j];
617+
}
618+
608619
if (result[TOTAL_ERR_LENGTH] > length) {
609620
if (!mc_priv->part_len)
610621
mc_priv->part_len = length;
611622
else
612623
mc_priv->part_len += length;
613-
/*
614-
* The data can come in 2 stretches. Construct the regs from 2
615-
* messages the offset indicates the offset from which the data is to
616-
* be taken
617-
*/
618-
for (i = 0 ; i < length; i++) {
619-
k = offset + i;
620-
j = ERROR_DATA + i;
621-
mc_priv->regs[k] = result[j];
622-
}
624+
623625
if (mc_priv->part_len < result[TOTAL_ERR_LENGTH])
624626
return 0;
625627
mc_priv->part_len = 0;
@@ -705,7 +707,7 @@ static int rpmsg_cb(struct rpmsg_device *rpdev, void *data,
705707
/* Convert to bytes */
706708
length = result[TOTAL_ERR_LENGTH] * 4;
707709
log_non_standard_event(sec_type, &amd_versalnet_guid, mc_priv->message,
708-
sec_sev, (void *)&result[ERROR_DATA], length);
710+
sec_sev, (void *)&mc_priv->regs, length);
709711

710712
return 0;
711713
}

0 commit comments

Comments
 (0)