Skip to contentSkip to conversation

EDAC, i7core/sb_edac/skx_edac: Fix uncorrected error counting

PATCH Luck, Tony 1 participant 1 message Sep 28, 2018

Subsystems (4)
lore
Share & tools
lore

Luck, Tony

author maintainer
#0 lore raw

We pick up the count of errors from bits 52:38 of the machine check bank status register. But this is the count of *corrected* errors. If we are logging an uncorrected error, the h/w set this field to 0. Which means that when we call into edac_mc_handle_error() the EDAC core will carefully add zero to the appropriate uncorrected error counts.

---

So I was digging around in /sys/devices/system/edac/mc/mc*/* and noticed the the "ue_count" files all read "0" even after injecting and recovering from some 2-bit error.

 drivers/edac/i7core_edac.c | 1 +
 drivers/edac/sb_edac.c     | 1 +
 drivers/edac/skx_edac.c    | 1 +
 3 files changed, 3 insertions(+)
drivers/edac/i7core_edac.c +1 -0
index 8e120bf60624..f1d19504a028 100644
@@ -1711,6 +1711,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
 	u32 errnum = find_first_bit(&error, 32);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv)
 			tp_event = HW_EVENT_ERR_FATAL;
 		else
drivers/edac/sb_edac.c +1 -0
index 07726fb00321..72cea3cb8622 100644
@@ -2888,6 +2888,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
 		recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv) {
 			type = "FATAL";
 			tp_event = HW_EVENT_ERR_FATAL;
drivers/edac/skx_edac.c +1 -0
index fae095162c01..3c5c95428f1d 100644
@@ -959,6 +959,7 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
 	recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv) {
 			type = "FATAL";
 			tp_event = HW_EVENT_ERR_FATAL;