diff options
Diffstat (limited to 'drivers/acpi/apei/ghes.c')
-rw-r--r-- | drivers/acpi/apei/ghes.c | 25 |
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 | ||
363 | static void ghes_print_estatus(const char *pfx, struct ghes *ghes) | 363 | static 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 | } | 377 | static 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 | ||
383 | static int ghes_proc(struct ghes *ghes) | 386 | static 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; |