Add a driver to report Firmware first errors (via GHES)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | edac: add support for raw error reportsdrivers/ drivers/ | +100 | 5 replies | |
| 2/12 | edac: add support for error type "Info"include/ include/ | +17 | 0 replies | |
| 3/12 | ghes: move structures/enum to a header filedrivers/ include/ | +47 | 0 replies | |
| 4/12 | ghes: add the needed hooks for EDAC error reportdrivers/ include/ | +44 | 0 replies | |
| 5/12 | ghes_edac: Register at EDAC core the BIOS reportMAINTAINERS drivers/ drivers/ +1 more | +145 | 0 replies | |
| 6/12 | ghes_edac: add support for reporting errors via EDACdrivers/ | +48 | 0 replies | |
| 7/12 | ghes_edac: do a better job of filling EDAC DIMM infodrivers/ | +180 | 0 replies | |
| 8/12 | ghes_edac: Don't credit the same memory dimm twicedrivers/ | +13 | 0 replies | |
| 9/12 | ghes_edac: Improve driver's printk messagesdrivers/ | +27 | 0 replies | |
| 10/12 | edac: put all arguments for the raw error handling call into a structdrivers/ drivers/ drivers/ +1 more | +123 | 0 replies | |
| 11/12 | ghes_edac: Make it compliant with UEFI spec 2.3.1drivers/ | +180 | 0 replies | |
| 12/12 | ghes_edac: Fix RAS tracingdrivers/ drivers/ | +21 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH EDACv2 00/12] Add a driver to report Firmware first errors (via GHES)
There are currently 3 error mechanisms inside the Linux Kernel:
edac, mcelog and ghes.
Unfortunately, not all those error mechanisms will work at the same time, as accessing the error registers by the BIOS may interfere on reading them from OS.
So, all those 3 mechanisms need to be integrated, in order to avoid such problems.
This patch series adds a new EDAC driver that uses "Firmware first" APEI/GHES as an error report mechanism. It automatically disables the hardware-driven EDAC drivers when GHES is enabled, preventing to have both OS and BIOS to read at the very same error mechanisms.
It was tested on a "Lizard Head Pass" Intel machine, equipped with BIOS SE5C600.86B.99.99.x059.091020121352 (09/10/2012).
Test results:
dmesg logs:
...
[ 771.616999] mce: [Hardware Error]: Machine check events logged
[ 771.623635] {3}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 0
[ 771.632872] {3}[Hardware Error]: APEI generic hardware error status
[ 771.639875] {3}[Hardware Error]: severity: 2, corrected
[ 771.645708] {3}[Hardware Error]: section: 0, severity: 2, corrected
[ 771.652704] {3}[Hardware Error]: flags: 0x01
[ 771.657470] {3}[Hardware Error]: primary
[ 771.661869] {3}[Hardware Error]: section_type: memory error
[ 771.668103] {3}[Hardware Error]: error_status: 0x0000000000000400
[ 771.674911] {3}[Hardware Error]: physical_address: 0x000000080b7f0000
[ 771.682098] {3}[Hardware Error]: node: 0
[ 771.686474] {3}[Hardware Error]: card: 0
[ 771.690866] {3}[Hardware Error]: module: 0
[ 771.695440] {3}[Hardware Error]: device: 0
[ 771.700027] {3}[Hardware Error]: error_type: 18, unknown
[ 771.706013] EDAC DEBUG: ghes_edac_report_mem_error: error validation_bits: 0x000040bb
[ 771.706023] EDAC MC0: 1 CE reserved error (18) on unknown label (node:0 card:0 module:0 page:0x80b7f0 offset:0x0 grain:0 syndrome:0x0 - status(0x0000000000000400): Storage error in DRAM memory)trace logs (for 3 injected errors):
# tracer: nop
#
# entries-in-buffer/entries-written: 3/3 #P:64
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/0:2-590 [000] .... 120.908219: mc_event: 1 Corrected error: reserved error (18) on unknown label (mc:0 location:-1:-1:-1 address:0x00000000 grain:1 syndrome:0x00000000 APEI location: node:3 card:0 module:0 status(0x0000000000000400): Storage error in DRAM memory)
kworker/0:2-590 [000] .... 281.557076: mc_event: 1 Corrected error: reserved error (18) on unknown label (mc:0 location:-1:-1:-1 address:0x00000000 grain:1 syndrome:0x00000000 APEI location: node:3 card:0 module:1 status(0x0000000000000400): Storage error in DRAM memory)
kworker/0:1-1989 [000] .... 771.706018: mc_event: 1 Corrected error: reserved error (18) on unknown label (mc:0 location:-1:-1:-1 address:0x000080b7 grain:1 syndrome:0x00000000 APEI location: node:0 card:0 module:0 status(0x0000000000000400): Storage error in DRAM memory)-
Version 2:
- for the sake of focusing on the important patches, I removed from this patch series 4 patches that were submitted on version 1 and are just trivial cleanups and a simple EDAC internal API addition:
c2c93db - edac: remove proc_name from mci structure c66b5a7 - edac: add a new memory layer type
4ab19b0 - edac: initialize the core earlier
3d95882 - edac: better report error conditions in debug mode
Those 4 patches can be found on my experimental git tree, at:
http://git.infradead.org/users/mchehab/edac.git/shortlog/refs/heads/experimental
- I added in this series the 6 additional patches that improve ghes_edac output;
- Several patches got fold, to keep the patch series clean. So, instead of having 13+6 patches, the entire series has now 12 patches;
- A new patch was added from Borislav's feedback about patch 07/13:
3897b2a - edac: put all arguments for the raw error handling call into a struct (79 minutes ago)
- Patch 03/13 was changed according with Huang's feedback. It is now patch 04/12. Due to the removal of mci from ghes structure, patch 05/12 was changed to store the ghes <==> mci association inside the driver's private data. Subsequent patches required changes as well to cope with the new way to retrieve data;
- the buffer usage by ghes_edac_report_mem_error() was reduced, by storing the temporary buffers inside the private structure;
- minor cleanups.
To help reviewers, I'm enclosing the diff between v1 and v2 at the end of this email.
Mauro Carvalho Chehab (12):
edac: add support for raw error reports
edac: add support for error type "Info"
ghes: move structures/enum to a header file
ghes: add the needed hooks for EDAC error report
ghes_edac: Register at EDAC core the BIOS report
ghes_edac: add support for reporting errors via EDAC
ghes_edac: do a better job of filling EDAC DIMM info
ghes_edac: Don't credit the same memory dimm twice
ghes_edac: Improve driver's printk messages
edac: put all arguments for the raw error handling call into a struct
ghes_edac: Make it compliant with UEFI spec 2.3.1
ghes_edac: Fix RAS tracing
MAINTAINERS | 7 + drivers/acpi/apei/ghes.c | 71 ++----- drivers/edac/Kconfig | 23 ++ drivers/edac/Makefile | 1 + drivers/edac/edac_core.h | 5 + drivers/edac/edac_mc.c | 119 +++++++---- drivers/edac/ghes_edac.c | 537 +++++++++++++++++++++++++++++++++++++++++++++++ include/acpi/ghes.h | 70 ++++++ include/linux/edac.h | 72 +++++++ include/ras/ras_event.h | 4 +- 10 files changed, 814 insertions(+), 95 deletions(-) create mode 100644 drivers/edac/ghes_edac.c create mode 100644 include/acpi/ghes.h
----------------------------
Difference against version 1:
----------------------------
drivers/acpi/apei/ghes.c +9 -6
@@ -903,6 +903,11 @@ static int ghes_probe(struct platform_device *ghes_dev) ghes =NULL ; goto err; } + + rc =ghes_edac_register (ghes, &ghes_dev->dev); +if (rc <0 ) + goto err; +switch (generic->notify.type) {case ACPI_HEST_NOTIFY_POLLED : ghes->timer.function = ghes_poll_func;
@@ -915,13 +920,13 @@ static int ghes_probe(struct platform_device *ghes_dev)if (acpi_gsi_to_irq (generic->notify.vector, &ghes->irq)) {pr_err (GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n" , generic->header.source_id); - goto err; + goto err2; }if (request_irq (ghes->irq, ghes_irq_func,0 ,"GHES IRQ" , ghes)) {pr_err (GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n" , generic->header.source_id); - goto err; + goto err2; }break ;case ACPI_HEST_NOTIFY_SCI :
@@ -946,11 +951,9 @@ static int ghes_probe(struct platform_device *ghes_dev) }platform_set_drvdata (ghes_dev, ghes); - rc =ghes_edac_register (ghes, &ghes_dev->dev); -if (rc <0 ) - goto err; -return 0 ; +err2: +ghes_edac_unregister (ghes); err:if (ghes) {ghes_fini (ghes);
drivers/edac/edac_mc.c +1 -2
@@ -818,9 +818,8 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev)return NULL ; } -if (!del_mc_from_global_list (mci)) { +if (!del_mc_from_global_list (mci)) edac_mc_owner =NULL ; - }mutex_unlock (&mem_ctls_mutex);/* flush workq processes */
drivers/edac/ghes_edac.c +70 -36
230 lines not on this page · raw message
include/acpi/ghes.h +0 -2
@@ -22,8 +22,6 @@ struct ghes {struct timer_list timer;unsigned int irq; }; - -struct mem_ctl_info *mci; };struct ghes_estatus_node {