aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2010-12-06 21:22:31 -0500
committerLen Brown <len.brown@intel.com>2010-12-13 23:42:39 -0500
commit32c361f574f85fa47600d84900598e2efc99082e (patch)
treecb78461432df92afee470b04e8eb20182e8ef28d /drivers/acpi
parentf59c55d04b43bd72df8efa692dd07224fe94d1ac (diff)
ACPI, APEI, Report GHES error information via printk
printk is one of the methods to report hardware errors to user space. This patch implements hardware error reporting for GHES via printk. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-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: