* [PATCH for tip/mce3] x86, mce: fix mce printing
@ 2009-06-11 7:04 Hidetoshi Seto
2009-06-11 9:42 ` Ingo Molnar
2009-06-11 9:48 ` [tip:branch?] x86, mce: Fix " tip-bot for Hidetoshi Seto
0 siblings, 2 replies; 3+ messages in thread
From: Hidetoshi Seto @ 2009-06-11 7:04 UTC (permalink / raw)
To: linux-kernel; +Cc: Huang Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner
This patch does:
- Add print_mce_head() instead of first flag
- Make header to be printed always
- Stop double printing of corrected errors
[ This portion is originate from Huang Ying's patch ]
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
arch/x86/kernel/cpu/mcheck/mce.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index d4e7b59..6a3127e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -180,12 +180,8 @@ void mce_log(struct mce *mce)
set_bit(0, ¬ify_user);
}
-static void print_mce(struct mce *m, int *first)
+static void print_mce(struct mce *m)
{
- if (*first) {
- printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
- *first = 0;
- }
printk(KERN_EMERG
"CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
m->extcpu, m->mcgstatus, m->bank, m->status);
@@ -208,6 +204,11 @@ static void print_mce(struct mce *m, int *first)
m->apicid);
}
+static void print_mce_head(void)
+{
+ printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
+}
+
static void print_mce_tail(void)
{
printk(KERN_EMERG "This is not a software problem!\n"
@@ -234,7 +235,6 @@ static void wait_for_panic(void)
static void mce_panic(char *msg, struct mce *final, char *exp)
{
int i;
- int first = 1;
/*
* Make sure only one CPU runs in machine check panic
@@ -245,23 +245,27 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
bust_spinlocks(1);
console_verbose();
+ print_mce_head();
/* First print corrected ones that are still unlogged */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
- if ((m->status & MCI_STATUS_VAL) &&
- !(m->status & MCI_STATUS_UC))
- print_mce(m, &first);
+ if (!(m->status & MCI_STATUS_VAL))
+ continue;
+ if (!(m->status & MCI_STATUS_UC))
+ print_mce(m);
}
/* Now print uncorrected but with the final one last */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
if (!(m->status & MCI_STATUS_VAL))
continue;
+ if (!(m->status & MCI_STATUS_UC))
+ continue;
if (!final || memcmp(m, final, sizeof(struct mce)))
- print_mce(m, &first);
+ print_mce(m);
}
if (final)
- print_mce(final, &first);
+ print_mce(final);
if (cpu_missing)
printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
print_mce_tail();
--
1.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for tip/mce3] x86, mce: fix mce printing
2009-06-11 7:04 [PATCH for tip/mce3] x86, mce: fix mce printing Hidetoshi Seto
@ 2009-06-11 9:42 ` Ingo Molnar
2009-06-11 9:48 ` [tip:branch?] x86, mce: Fix " tip-bot for Hidetoshi Seto
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2009-06-11 9:42 UTC (permalink / raw)
To: Hidetoshi Seto; +Cc: linux-kernel, Huang Ying, H. Peter Anvin, Thomas Gleixner
* Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> wrote:
> This patch does:
> - Add print_mce_head() instead of first flag
> - Make header to be printed always
> - Stop double printing of corrected errors
>
> [ This portion is originate from Huang Ying's patch ]
>
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
> ---
> arch/x86/kernel/cpu/mcheck/mce.c | 26 +++++++++++++++-----------
> 1 files changed, 15 insertions(+), 11 deletions(-)
Applied to tip:x86/mce3 with minor edits to the title and the
changelog, thanks Hidetoshi!
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:branch?] x86, mce: Fix mce printing
2009-06-11 7:04 [PATCH for tip/mce3] x86, mce: fix mce printing Hidetoshi Seto
2009-06-11 9:42 ` Ingo Molnar
@ 2009-06-11 9:48 ` tip-bot for Hidetoshi Seto
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Hidetoshi Seto @ 2009-06-11 9:48 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, seto.hidetoshi, tglx, mingo
Commit-ID: 77e26cca20013e9352a8df86a54640543304a23a
Gitweb: http://git.kernel.org/tip/77e26cca20013e9352a8df86a54640543304a23a
Author: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
AuthorDate: Thu, 11 Jun 2009 16:04:35 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 11 Jun 2009 11:42:17 +0200
x86, mce: Fix mce printing
This patch:
- Adds print_mce_head() instead of first flag
- Makes the header to be printed always
- Stops double printing of corrected errors
[ This portion originates from Huang Ying's patch ]
Originally-From: Huang Ying <ying.huang@intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
LKML-Reference: <4A30AC83.5010708@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/cpu/mcheck/mce.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index d4e7b59..6a3127e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -180,12 +180,8 @@ void mce_log(struct mce *mce)
set_bit(0, ¬ify_user);
}
-static void print_mce(struct mce *m, int *first)
+static void print_mce(struct mce *m)
{
- if (*first) {
- printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
- *first = 0;
- }
printk(KERN_EMERG
"CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
m->extcpu, m->mcgstatus, m->bank, m->status);
@@ -208,6 +204,11 @@ static void print_mce(struct mce *m, int *first)
m->apicid);
}
+static void print_mce_head(void)
+{
+ printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
+}
+
static void print_mce_tail(void)
{
printk(KERN_EMERG "This is not a software problem!\n"
@@ -234,7 +235,6 @@ static void wait_for_panic(void)
static void mce_panic(char *msg, struct mce *final, char *exp)
{
int i;
- int first = 1;
/*
* Make sure only one CPU runs in machine check panic
@@ -245,23 +245,27 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
bust_spinlocks(1);
console_verbose();
+ print_mce_head();
/* First print corrected ones that are still unlogged */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
- if ((m->status & MCI_STATUS_VAL) &&
- !(m->status & MCI_STATUS_UC))
- print_mce(m, &first);
+ if (!(m->status & MCI_STATUS_VAL))
+ continue;
+ if (!(m->status & MCI_STATUS_UC))
+ print_mce(m);
}
/* Now print uncorrected but with the final one last */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
if (!(m->status & MCI_STATUS_VAL))
continue;
+ if (!(m->status & MCI_STATUS_UC))
+ continue;
if (!final || memcmp(m, final, sizeof(struct mce)))
- print_mce(m, &first);
+ print_mce(m);
}
if (final)
- print_mce(final, &first);
+ print_mce(final);
if (cpu_missing)
printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
print_mce_tail();
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-11 9:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 7:04 [PATCH for tip/mce3] x86, mce: fix mce printing Hidetoshi Seto
2009-06-11 9:42 ` Ingo Molnar
2009-06-11 9:48 ` [tip:branch?] x86, mce: Fix " tip-bot for Hidetoshi Seto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox