2020-06-10 07:02:53

by Zhenzhong Duan

[permalink] [raw]
Subject: [PATCH] EDAC/mc: call edac_inc_ue_error() before panic

By calling edac_inc_ue_error() before panic, we get a correct UE error
count for core dump analysis.

Signed-off-by: Zhenzhong Duan <[email protected]>
---
drivers/edac/edac_mc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 75ede27..c1f23c2 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -1011,6 +1011,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,
@@ -1020,8 +1022,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)
--
1.8.3.1


2020-06-10 17:32:07

by Tony Luck

[permalink] [raw]
Subject: Re: [PATCH] EDAC/mc: call edac_inc_ue_error() before panic

On Wed, Jun 10, 2020 at 02:58:46PM +0800, Zhenzhong Duan wrote:
> By calling edac_inc_ue_error() before panic, we get a correct UE error
> count for core dump analysis.

Looks accurate, and I'll add the patch to be applied. But I wonder
how big a problem it is. Isn't most of the information deriveable
from the panic message?

>
> Signed-off-by: Zhenzhong Duan <[email protected]>
> ---
> drivers/edac/edac_mc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
> index 75ede27..c1f23c2 100644
> --- a/drivers/edac/edac_mc.c
> +++ b/drivers/edac/edac_mc.c
> @@ -1011,6 +1011,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,
> @@ -1020,8 +1022,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)
> --
> 1.8.3.1
>

2020-06-11 02:39:53

by Zhenzhong Duan

[permalink] [raw]
Subject: Re: [PATCH] EDAC/mc: call edac_inc_ue_error() before panic

On Thu, Jun 11, 2020 at 1:19 AM Luck, Tony <[email protected]> wrote:
>
> On Wed, Jun 10, 2020 at 02:58:46PM +0800, Zhenzhong Duan wrote:
> > By calling edac_inc_ue_error() before panic, we get a correct UE error
> > count for core dump analysis.
>
> Looks accurate, and I'll add the patch to be applied. But I wonder
> how big a problem it is. Isn't most of the information deriveable
> from the panic message?

Thanks for review.
Yes, it's totally not a problem. I'm a little too strict here.

Zhenzhong