EDAC, {i7core,sb,skx}_edac: Fix uncorrected error counting
authorTony Luck <tony.luck@intel.com>
Fri, 28 Sep 2018 21:39:34 +0000 (14:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:16:56 +0000 (11:16 -0800)
commit 432de7fd7630c84ad24f1c2acd1e3bb4ce3741ca upstream.

The count of errors is picked up from bits 52:38 of the machine check
bank status register. But this is the count of *corrected* errors. If an
uncorrected error is being logged, the h/w sets this field to 0. Which
means that when edac_mc_handle_error() is called, the EDAC core will
carefully add zero to the appropriate uncorrected error counts.

Signed-off-by: Tony Luck <tony.luck@intel.com>
[ Massage commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Cc: Aristeu Rozanski <aris@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180928213934.19890-1-tony.luck@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/edac/i7core_edac.c
drivers/edac/sb_edac.c
drivers/edac/skx_edac.c

index b60932026e34cadafb4e7f2db0fc4958e3a62c64..f95d5b9c5551d8f1ae958bceaaadc987ec35aad5 100644 (file)
@@ -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
index 3c47e6361d8127faeacce4d8b88df28d849a1eb2..e9391950a84378d3f9ad29a0f6bf1668f60fd0dd 100644 (file)
@@ -2934,6 +2934,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;
index 0ff4878c2aa18b77bc437167a6dedfe7bac7a141..dae1e7936870c349644c0a1c4dbdf535d73ea587 100644 (file)
@@ -897,6 +897,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;