From 904774d9a960d21f39e938133983e9b522b8f2f4 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Wed, 13 Jul 2011 13:14:15 +0800 Subject: [PATCH] --- yaml --- r: 262351 b: refs/heads/master c: 5588340d46a484da53bbce8136184d9c7fbc259c h: refs/heads/master i: 262349: 39cb7fe6f5984c9a71f6ee524e9649190d311594 262347: eebeccff5f2f46a0707f3ec7f98fbc5ccc8b00d6 262343: 56cd50aa1873182d56e8b347fc153e8d8041584d 262335: abff231ea45b098631eb5a02d16eaf0b7b4042cd v: v3 --- [refs] | 2 +- trunk/drivers/acpi/apei/ghes.c | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index c2d4dfe3015c..ee8444c86b9a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d37afc50e618271839f001ea653949eefc728167 +refs/heads/master: 5588340d46a484da53bbce8136184d9c7fbc259c diff --git a/trunk/drivers/acpi/apei/ghes.c b/trunk/drivers/acpi/apei/ghes.c index f703b2881153..f339c0f8369c 100644 --- a/trunk/drivers/acpi/apei/ghes.c +++ b/trunk/drivers/acpi/apei/ghes.c @@ -360,11 +360,8 @@ static void ghes_do_proc(struct ghes *ghes) } } -static void ghes_print_estatus(const char *pfx, struct ghes *ghes) +static void __ghes_print_estatus(const char *pfx, struct ghes *ghes) { - /* Not more than 2 messages every 5 seconds */ - static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2); - if (pfx == NULL) { if (ghes_severity(ghes->estatus->error_severity) <= GHES_SEV_CORRECTED) @@ -372,12 +369,18 @@ static void ghes_print_estatus(const char *pfx, struct ghes *ghes) else pfx = KERN_ERR HW_ERR; } - if (__ratelimit(&ratelimit)) { - printk( - "%s""Hardware error from APEI Generic Hardware Error Source: %d\n", - pfx, ghes->generic->header.source_id); - apei_estatus_print(pfx, ghes->estatus); - } + printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n", + pfx, ghes->generic->header.source_id); + apei_estatus_print(pfx, ghes->estatus); +} + +static void ghes_print_estatus(const char *pfx, struct ghes *ghes) +{ + /* Not more than 2 messages every 5 seconds */ + static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2); + + if (__ratelimit(&ratelimit)) + __ghes_print_estatus(pfx, ghes); } static int ghes_proc(struct ghes *ghes) @@ -476,7 +479,7 @@ static int ghes_notify_nmi(struct notifier_block *this, if (sev_global >= GHES_SEV_PANIC) { oops_begin(); - ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global); + __ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global); /* reboot to log the error! */ if (panic_timeout == 0) panic_timeout = ghes_panic_timeout;