Re: [PATCH V10 RESEND] EDAC: Add EDAC driver for loongson memory controller

From: Borislav Petkov
Date: Sat Jan 04 2025 - 05:47:41 EST


On Sat, Jan 04, 2025 at 11:31:00AM +0100, Borislav Petkov wrote:
> > That ECC register can not be zeroed.
>
> Pfff, that's some weird hardware you have there. Oh well. Lemme take a look at
> your patch.

diff --git a/drivers/edac/loongson_edac.c b/drivers/edac/loongson_edac.c
index e267b526b52f..38745800ed01 100644
--- a/drivers/edac/loongson_edac.c
+++ b/drivers/edac/loongson_edac.c
@@ -15,6 +15,13 @@

struct loongson_edac_pvt {
void __iomem *ecc_base;
+
+ /*
+ * The ECC register in this controller records the number of errors
+ * encountered since reset and cannot be zeroed so in order to be able
+ * to report the error count at each check, this records the previous
+ * register state.
+ */
int last_ce_count;
};


--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette