Re: [PATCH v2 1/1] edac: fsl_ddr_edac: fix expected data message

Borislav Petkov
2020-09-08T19:24:33Z

On Fri, Sep 04, 2020 at 03:32:58PM +0200, Gregor Herburger wrote:
> That shouldn't happen. The whole if-block is only executed when a single
> bit correctable error has occured (DDR_EDE_SBE). So we always should have
> bad_data_bit or bad_ecc_bit (exclusively).

Ooh, that sbe_ecc_decode() function would give you either the data bit
- if that one is in error - and if not the data bit, then the ECC bit.
Aha.

Ok, so what the driver should do, IMO, is this:

if (bad_data_bit != -1) {
...

fsl_mc_printk("Single-bit data error, ... ", bad_data_bit);
fsl_mc_printk("Expected Data/Captured Data, ... ", exp_high, exp_low, cap_high, cap_low);
}

if (bad_ecc_bit != -1) {
...

fsl_mc_printk("Single-bit ECC error, ... ", bad_ecc_bit);
fsl_mc_printk("Expected ECC/Captured ECC, ... ", exp_syndrome, syndrome);
}

This way you only print either the data or the ECC value which was in
error but not both.

Makes sense?

> Also i just noticed in the kernel log is no hint that this is an
> single bit error. Maybe we should add this too?

Yap, see above.

--
Regards/Gruss,
Boris.