aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 0d505e59214d..51905d07a4d9 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -43,6 +43,7 @@
43#include <linux/kdebug.h> 43#include <linux/kdebug.h>
44#include <linux/platform_device.h> 44#include <linux/platform_device.h>
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/ratelimit.h>
46#include <acpi/apei.h> 47#include <acpi/apei.h>
47#include <acpi/atomicio.h> 48#include <acpi/atomicio.h>
48#include <acpi/hed.h> 49#include <acpi/hed.h>
@@ -255,11 +256,26 @@ static void ghes_do_proc(struct ghes *ghes)
255 } 256 }
256#endif 257#endif
257 } 258 }
259}
258 260
259 if (!processed && printk_ratelimit()) 261static void ghes_print_estatus(const char *pfx, struct ghes *ghes)
260 pr_warning(GHES_PFX 262{
261 "Unknown error record from generic hardware error source: %d\n", 263 /* Not more than 2 messages every 5 seconds */
262 ghes->generic->header.source_id); 264 static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2);
265
266 if (pfx == NULL) {
267 if (ghes_severity(ghes->estatus->error_severity) <=
268 GHES_SEV_CORRECTED)
269 pfx = KERN_WARNING HW_ERR;
270 else
271 pfx = KERN_ERR HW_ERR;
272 }
273 if (__ratelimit(&ratelimit)) {
274 printk(
275 "%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
276 pfx, ghes->generic->header.source_id);
277 apei_estatus_print(pfx, ghes->estatus);
278 }
263} 279}
264 280
265static int ghes_proc(struct ghes *ghes) 281static int ghes_proc(struct ghes *ghes)
@@ -269,6 +285,7 @@ static int ghes_proc(struct ghes *ghes)
269 rc = ghes_read_estatus(ghes, 0); 285 rc = ghes_read_estatus(ghes, 0);
270 if (rc) 286 if (rc)
271 goto out; 287 goto out;
288 ghes_print_estatus(NULL, ghes);
272 ghes_do_proc(ghes); 289 ghes_do_proc(ghes);
273 290
274out: 291out: