aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2011-07-13 01:14:15 -0400
committerLen Brown <len.brown@intel.com>2011-07-13 23:33:57 -0400
commit5588340d46a484da53bbce8136184d9c7fbc259c (patch)
treebd6ac131e5f50cca56c35849e39f106b18c96c26 /drivers/acpi/apei
parentd37afc50e618271839f001ea653949eefc728167 (diff)
ACPI, APEI, GHES, Do not ratelimit fatal error printk before panic
printk is used by GHES to report hardware errors. Normally, the printk will be ratelimited to avoid too many hardware error reports in kernel log. Because there may be thousands or even millions of corrected hardware errors during system running. That is different for fatal hardware error, because system will go panic as soon as possible, there will be no more than several error records. And these error records are valuable for system fault diagnosis, so they should not be ratelimited. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index f703b2881153..f339c0f8369c 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -360,11 +360,8 @@ static void ghes_do_proc(struct ghes *ghes)
360 } 360 }
361} 361}
362 362
363static void ghes_print_estatus(const char *pfx, struct ghes *ghes) 363static void __ghes_print_estatus(const char *pfx, struct ghes *ghes)
364{ 364{
365 /* Not more than 2 messages every 5 seconds */
366 static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2);
367
368 if (pfx == NULL) { 365 if (pfx == NULL) {
369 if (ghes_severity(ghes->estatus->error_severity) <= 366 if (ghes_severity(ghes->estatus->error_severity) <=
370 GHES_SEV_CORRECTED) 367 GHES_SEV_CORRECTED)
@@ -372,12 +369,18 @@ static void ghes_print_estatus(const char *pfx, struct ghes *ghes)
372 else 369 else
373 pfx = KERN_ERR HW_ERR; 370 pfx = KERN_ERR HW_ERR;
374 } 371 }
375 if (__ratelimit(&ratelimit)) { 372 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
376 printk( 373 pfx, ghes->generic->header.source_id);
377 "%s""Hardware error from APEI Generic Hardware Error Source: %d\n", 374 apei_estatus_print(pfx, ghes->estatus);
378 pfx, ghes->generic->header.source_id); 375}
379 apei_estatus_print(pfx, ghes->estatus); 376
380 } 377static void ghes_print_estatus(const char *pfx, struct ghes *ghes)
378{
379 /* Not more than 2 messages every 5 seconds */
380 static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2);
381
382 if (__ratelimit(&ratelimit))
383 __ghes_print_estatus(pfx, ghes);
381} 384}
382 385
383static int ghes_proc(struct ghes *ghes) 386static int ghes_proc(struct ghes *ghes)
@@ -476,7 +479,7 @@ static int ghes_notify_nmi(struct notifier_block *this,
476 479
477 if (sev_global >= GHES_SEV_PANIC) { 480 if (sev_global >= GHES_SEV_PANIC) {
478 oops_begin(); 481 oops_begin();
479 ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global); 482 __ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global);
480 /* reboot to log the error! */ 483 /* reboot to log the error! */
481 if (panic_timeout == 0) 484 if (panic_timeout == 0)
482 panic_timeout = ghes_panic_timeout; 485 panic_timeout = ghes_panic_timeout;