From: Huang Ying <ying.huang@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
Tony Luck <tony.luck@intel.com>,
ying.huang@intel.com, linux-acpi@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>
Subject: [PATCH -v2 3/3] ACPI, APEI, report GHES error information via printk
Date: Tue, 30 Nov 2010 10:51:41 +0800 [thread overview]
Message-ID: <1291085501-31494-4-git-send-email-ying.huang@intel.com> (raw)
In-Reply-To: <1291085501-31494-1-git-send-email-ying.huang@intel.com>
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>
---
drivers/acpi/apei/ghes.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -255,11 +255,23 @@ static void ghes_do_proc(struct ghes *gh
}
#endif
}
+}
- if (!processed && printk_ratelimit())
- pr_warning(GHES_PFX
- "Unknown error record from generic hardware error source: %d\n",
- ghes->generic->header.source_id);
+static void ghes_print_estatus(const char *pfx, struct ghes *ghes)
+{
+ if (pfx == NULL) {
+ if (ghes_severity(ghes->estatus->error_severity) <=
+ GHES_SEV_CORRECTED)
+ pfx = KERN_WARNING HW_ERR;
+ else
+ pfx = KERN_ERR HW_ERR;
+ }
+ if (printk_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);
+ }
}
static int ghes_proc(struct ghes *ghes)
@@ -269,6 +281,7 @@ static int ghes_proc(struct ghes *ghes)
rc = ghes_read_estatus(ghes, 0);
if (rc)
goto out;
+ ghes_print_estatus(NULL, ghes);
ghes_do_proc(ghes);
out:
next prev parent reply other threads:[~2010-11-30 2:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-30 2:51 [PATCH -v2 0/3] Report APEI GHES error information via printk Huang Ying
2010-11-30 2:51 ` [PATCH -v2 1/3] Add CPER PCIe error section structure and constants definition Huang Ying
2010-11-30 2:51 ` [PATCH -v2 2/3] ACPI, APEI, Add APEI generic error status print support Huang Ying
2010-11-30 3:03 ` Andrew Morton
2010-11-30 3:29 ` Huang Ying
2010-11-30 3:40 ` Andrew Morton
2010-11-30 7:00 ` Huang Ying
2010-11-30 23:49 ` Andrew Morton
2010-12-01 0:04 ` huang ying
2010-11-30 18:00 ` Luck, Tony
2010-11-30 18:17 ` Andrew Morton
2010-11-30 23:56 ` huang ying
2010-11-30 2:51 ` Huang Ying [this message]
2010-11-30 3:07 ` [PATCH -v2 3/3] ACPI, APEI, report GHES error information via printk Andrew Morton
2010-11-30 3:35 ` Huang Ying
2010-11-30 5:47 ` KOSAKI Motohiro
2010-11-30 6:20 ` Huang Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291085501-31494-4-git-send-email-ying.huang@intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox