aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2011-12-07 22:25:44 -0500
committerLen Brown <len.brown@intel.com>2012-01-17 03:54:31 -0500
commit5ba82ab534a325d310fe02af1c149f1072792c7b (patch)
treea92545ade1a4898431dfd0f6ad9897c6c03931cb
parentad6861547b52ad7c31eacc336b79ac91d7fded75 (diff)
ACPI, APEI, GHES, Distinguish interleaved error report in kernel log
In most cases, printk only guarantees messages from different printk calling will not be interleaved between each other. But, one APEI GHES hardware error report will involve multiple printk calling, normally each for one line. So it is possible that the hardware error report comes from different generic hardware error source will be interleaved. In this patch, a sequence number is prefixed to each line of error report. So that, even if they are interleaved, they still can be distinguished by the prefixed sequence number. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/apei/ghes.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 511b971d1148..9dcb2d86aeab 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -506,16 +506,22 @@ static void __ghes_print_estatus(const char *pfx,
506 const struct acpi_hest_generic *generic, 506 const struct acpi_hest_generic *generic,
507 const struct acpi_hest_generic_status *estatus) 507 const struct acpi_hest_generic_status *estatus)
508{ 508{
509 static atomic_t seqno;
510 unsigned int curr_seqno;
511 char pfx_seq[64];
512
509 if (pfx == NULL) { 513 if (pfx == NULL) {
510 if (ghes_severity(estatus->error_severity) <= 514 if (ghes_severity(estatus->error_severity) <=
511 GHES_SEV_CORRECTED) 515 GHES_SEV_CORRECTED)
512 pfx = KERN_WARNING HW_ERR; 516 pfx = KERN_WARNING;
513 else 517 else
514 pfx = KERN_ERR HW_ERR; 518 pfx = KERN_ERR;
515 } 519 }
520 curr_seqno = atomic_inc_return(&seqno);
521 snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
516 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n", 522 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
517 pfx, generic->header.source_id); 523 pfx_seq, generic->header.source_id);
518 apei_estatus_print(pfx, estatus); 524 apei_estatus_print(pfx_seq, estatus);
519} 525}
520 526
521static int ghes_print_estatus(const char *pfx, 527static int ghes_print_estatus(const char *pfx,
@@ -798,7 +804,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
798 804
799 if (sev_global >= GHES_SEV_PANIC) { 805 if (sev_global >= GHES_SEV_PANIC) {
800 oops_begin(); 806 oops_begin();
801 __ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global->generic, 807 __ghes_print_estatus(KERN_EMERG, ghes_global->generic,
802 ghes_global->estatus); 808 ghes_global->estatus);
803 /* reboot to log the error! */ 809 /* reboot to log the error! */
804 if (panic_timeout == 0) 810 if (panic_timeout == 0)