diff options
author | Huang Ying <ying.huang@intel.com> | 2011-07-13 01:14:12 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-07-13 23:27:56 -0400 |
commit | 4d2b2956ef1113f1cc43e98e947c20d9c7d2712c (patch) | |
tree | f19e664132a6fe8173c03bb3be97ecf4a125185a /drivers/acpi | |
parent | 8d86e5f91440aa56a5df516bf58fe3883552ad56 (diff) |
ACPI, APEI, HEST, Detect duplicated hardware error source ID
The firmware on some machine will report duplicated hardware error
source ID in HEST. This is considered a firmware bug. To provide
better warning message, this patch adds duplicated hardware error
source ID detecting and corresponding printk.
This patch fixes #37412 on kernel bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=37412
Reported-by: marconifabio@ubuntu-it.org
Signed-off-by: Huang Ying <ying.huang@intel.com>
Tested-by: Mathias <janedo.spam@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/apei/hest.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index abda3786a5d7..181bc2f7bb74 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
@@ -139,13 +139,23 @@ static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) | |||
139 | { | 139 | { |
140 | struct platform_device *ghes_dev; | 140 | struct platform_device *ghes_dev; |
141 | struct ghes_arr *ghes_arr = data; | 141 | struct ghes_arr *ghes_arr = data; |
142 | int rc; | 142 | int rc, i; |
143 | 143 | ||
144 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) | 144 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) |
145 | return 0; | 145 | return 0; |
146 | 146 | ||
147 | if (!((struct acpi_hest_generic *)hest_hdr)->enabled) | 147 | if (!((struct acpi_hest_generic *)hest_hdr)->enabled) |
148 | return 0; | 148 | return 0; |
149 | for (i = 0; i < ghes_arr->count; i++) { | ||
150 | struct acpi_hest_header *hdr; | ||
151 | ghes_dev = ghes_arr->ghes_devs[i]; | ||
152 | hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data; | ||
153 | if (hdr->source_id == hest_hdr->source_id) { | ||
154 | pr_warning(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n", | ||
155 | hdr->source_id); | ||
156 | return -EIO; | ||
157 | } | ||
158 | } | ||
149 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); | 159 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); |
150 | if (!ghes_dev) | 160 | if (!ghes_dev) |
151 | return -ENOMEM; | 161 | return -ENOMEM; |