aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mcheck/mce.c
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2009-06-11 03:04:35 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-11 05:42:17 -0400
commit77e26cca20013e9352a8df86a54640543304a23a (patch)
tree71655e83a507a138fdf85449a561ebab12bf8702 /arch/x86/kernel/cpu/mcheck/mce.c
parent8051dbd2dfd1427cc102888d7d96bf39de0be150 (diff)
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>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce.c')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c26
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 d4e7b5947a0..6a3127ecb5c 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)
180 set_bit(0, &notify_user); 180 set_bit(0, &notify_user);
181} 181}
182 182
183static void print_mce(struct mce *m, int *first) 183static void print_mce(struct mce *m)
184{ 184{
185 if (*first) {
186 printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
187 *first = 0;
188 }
189 printk(KERN_EMERG 185 printk(KERN_EMERG
190 "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", 186 "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
191 m->extcpu, m->mcgstatus, m->bank, m->status); 187 m->extcpu, m->mcgstatus, m->bank, m->status);
@@ -208,6 +204,11 @@ static void print_mce(struct mce *m, int *first)
208 m->apicid); 204 m->apicid);
209} 205}
210 206
207static void print_mce_head(void)
208{
209 printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
210}
211
211static void print_mce_tail(void) 212static void print_mce_tail(void)
212{ 213{
213 printk(KERN_EMERG "This is not a software problem!\n" 214 printk(KERN_EMERG "This is not a software problem!\n"
@@ -234,7 +235,6 @@ static void wait_for_panic(void)
234static void mce_panic(char *msg, struct mce *final, char *exp) 235static void mce_panic(char *msg, struct mce *final, char *exp)
235{ 236{
236 int i; 237 int i;
237 int first = 1;
238 238
239 /* 239 /*
240 * Make sure only one CPU runs in machine check panic 240 * 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)
245 245
246 bust_spinlocks(1); 246 bust_spinlocks(1);
247 console_verbose(); 247 console_verbose();
248 print_mce_head();
248 /* First print corrected ones that are still unlogged */ 249 /* First print corrected ones that are still unlogged */
249 for (i = 0; i < MCE_LOG_LEN; i++) { 250 for (i = 0; i < MCE_LOG_LEN; i++) {
250 struct mce *m = &mcelog.entry[i]; 251 struct mce *m = &mcelog.entry[i];
251 if ((m->status & MCI_STATUS_VAL) && 252 if (!(m->status & MCI_STATUS_VAL))
252 !(m->status & MCI_STATUS_UC)) 253 continue;
253 print_mce(m, &first); 254 if (!(m->status & MCI_STATUS_UC))
255 print_mce(m);
254 } 256 }
255 /* Now print uncorrected but with the final one last */ 257 /* Now print uncorrected but with the final one last */
256 for (i = 0; i < MCE_LOG_LEN; i++) { 258 for (i = 0; i < MCE_LOG_LEN; i++) {
257 struct mce *m = &mcelog.entry[i]; 259 struct mce *m = &mcelog.entry[i];
258 if (!(m->status & MCI_STATUS_VAL)) 260 if (!(m->status & MCI_STATUS_VAL))
259 continue; 261 continue;
262 if (!(m->status & MCI_STATUS_UC))
263 continue;
260 if (!final || memcmp(m, final, sizeof(struct mce))) 264 if (!final || memcmp(m, final, sizeof(struct mce)))
261 print_mce(m, &first); 265 print_mce(m);
262 } 266 }
263 if (final) 267 if (final)
264 print_mce(final, &first); 268 print_mce(final);
265 if (cpu_missing) 269 if (cpu_missing)
266 printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n"); 270 printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
267 print_mce_tail(); 271 print_mce_tail();