EDAC/mc: Call edac_inc_ue_error() before panic
authorZhenzhong Duan <zhenzhong.duan@gmail.com>
Wed, 10 Jun 2020 06:58:46 +0000 (14:58 +0800)
committerTony Luck <tony.luck@intel.com>
Mon, 15 Jun 2020 18:19:52 +0000 (11:19 -0700)
By calling edac_inc_ue_error() before panic, we get a correct UE error
count for core dump analysis.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20200610065846.3626-2-zhenzhong.duan@gmail.com
drivers/edac/edac_mc.c

index 5813e931f2f00f6848bc2dbeb3ecd96bec565bfa..01ff71f7b64562f37459b5dd6dd86835458d215e 100644 (file)
@@ -950,6 +950,8 @@ static void edac_ue_error(struct edac_raw_error_desc *e)
                        e->other_detail);
        }
 
+       edac_inc_ue_error(e);
+
        if (edac_mc_get_panic_on_ue()) {
                panic("UE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld%s%s)\n",
                        e->msg,
@@ -959,8 +961,6 @@ static void edac_ue_error(struct edac_raw_error_desc *e)
                        *e->other_detail ? " - " : "",
                        e->other_detail);
        }
-
-       edac_inc_ue_error(e);
 }
 
 static void edac_inc_csrow(struct edac_raw_error_desc *e, int row, int chan)