[kernel/f17] ACPI, APEI, Avoid too much error reporting in runtime
Justin M. Forbes
jforbes at fedoraproject.org
Fri Jul 6 21:20:34 UTC 2012
commit a5a7f0c68477c95bfd80100893ec33212591d37c
Author: Justin M. Forbes <jforbes at redhat.com>
Date: Fri Jul 6 16:19:57 2012 -0500
ACPI, APEI, Avoid too much error reporting in runtime
ACPI-APEI-Avoid-too-much-error-reporting.patch | 121 ++++++++++++++++++++++++
kernel.spec | 7 ++
2 files changed, 128 insertions(+), 0 deletions(-)
---
diff --git a/ACPI-APEI-Avoid-too-much-error-reporting.patch b/ACPI-APEI-Avoid-too-much-error-reporting.patch
new file mode 100644
index 0000000..fe6e697
--- /dev/null
+++ b/ACPI-APEI-Avoid-too-much-error-reporting.patch
@@ -0,0 +1,121 @@
+commit 34ddeb035d704eafdcdb3cbc781894300136c3c4
+Author: Huang Ying <ying.huang at intel.com>
+Date: Tue Jun 12 11:20:19 2012 +0800
+
+ ACPI, APEI, Avoid too much error reporting in runtime
+
+ This patch fixed the following bug.
+
+ https://bugzilla.kernel.org/show_bug.cgi?id=43282
+
+ This is caused by a firmware bug checking (checking generic address
+ register provided by firmware) in runtime. The checking should be
+ done in address mapping time instead of runtime to avoid too much
+ error reporting in runtime.
+
+ Reported-by: Pawel Sikora <pluto at agmk.net>
+ Signed-off-by: Huang Ying <ying.huang at intel.com>
+ Tested-by: Jean Delvare <khali at linux-fr.org>
+ Cc: stable at vger.kernel.org
+ Signed-off-by: Len Brown <len.brown at intel.com>
+
+diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
+index 5577762..6686b1e 100644
+--- a/drivers/acpi/apei/apei-base.c
++++ b/drivers/acpi/apei/apei-base.c
+@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct apei_exec_context *ctx,
+ u8 ins = entry->instruction;
+
+ if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
+- return acpi_os_map_generic_address(&entry->register_region);
++ return apei_map_generic_address(&entry->register_region);
+
+ return 0;
+ }
+@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struct apei_exec_context *ctx,
+ u8 ins = entry->instruction;
+
+ if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
+- acpi_os_unmap_generic_address(&entry->register_region);
++ apei_unmap_generic_address(&entry->register_region);
+
+ return 0;
+ }
+@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
+ return 0;
+ }
+
++int apei_map_generic_address(struct acpi_generic_address *reg)
++{
++ int rc;
++ u32 access_bit_width;
++ u64 address;
++
++ rc = apei_check_gar(reg, &address, &access_bit_width);
++ if (rc)
++ return rc;
++ return acpi_os_map_generic_address(reg);
++}
++EXPORT_SYMBOL_GPL(apei_map_generic_address);
++
+ /* read GAR in interrupt (including NMI) or process context */
+ int apei_read(u64 *val, struct acpi_generic_address *reg)
+ {
+diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
+index cca240a..f220d64 100644
+--- a/drivers/acpi/apei/apei-internal.h
++++ b/drivers/acpi/apei/apei-internal.h
+@@ -7,6 +7,8 @@
+ #define APEI_INTERNAL_H
+
+ #include <linux/cper.h>
++#include <linux/acpi.h>
++#include <linux/acpi_io.h>
+
+ struct apei_exec_context;
+
+@@ -68,6 +70,13 @@ static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 actio
+ /* IP has been set in instruction function */
+ #define APEI_EXEC_SET_IP 1
+
++int apei_map_generic_address(struct acpi_generic_address *reg);
++
++static inline void apei_unmap_generic_address(struct acpi_generic_address *reg)
++{
++ acpi_os_unmap_generic_address(reg);
++}
++
+ int apei_read(u64 *val, struct acpi_generic_address *reg);
+ int apei_write(u64 val, struct acpi_generic_address *reg);
+
+diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
+index 9b3cac0..1599566 100644
+--- a/drivers/acpi/apei/ghes.c
++++ b/drivers/acpi/apei/ghes.c
+@@ -301,7 +301,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
+ if (!ghes)
+ return ERR_PTR(-ENOMEM);
+ ghes->generic = generic;
+- rc = acpi_os_map_generic_address(&generic->error_status_address);
++ rc = apei_map_generic_address(&generic->error_status_address);
+ if (rc)
+ goto err_free;
+ error_block_length = generic->error_block_length;
+@@ -321,7 +321,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
+ return ghes;
+
+ err_unmap:
+- acpi_os_unmap_generic_address(&generic->error_status_address);
++ apei_unmap_generic_address(&generic->error_status_address);
+ err_free:
+ kfree(ghes);
+ return ERR_PTR(rc);
+@@ -330,7 +330,7 @@ err_free:
+ static void ghes_fini(struct ghes *ghes)
+ {
+ kfree(ghes->estatus);
+- acpi_os_unmap_generic_address(&ghes->generic->error_status_address);
++ apei_unmap_generic_address(&ghes->generic->error_status_address);
+ }
+
+ enum {
diff --git a/kernel.spec b/kernel.spec
index 2f08a9d..d69860c 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -818,6 +818,8 @@ Patch22046: USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
Patch22047: USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
Patch22048: net-qmi_wwan-fix-Gobi-device-probing.patch
+Patch22050: ACPI-APEI-Avoid-too-much-error-reporting.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1574,6 +1576,8 @@ ApplyPatch USB-qmi_wwan-Make-forced-int-4-whitelist-generic.patch
ApplyPatch USB-qmi_wwan-Add-ZTE-Vodafone-K3520-Z.patch
ApplyPatch net-qmi_wwan-fix-Gobi-device-probing.patch
+ApplyPatch ACPI-APEI-Avoid-too-much-error-reporting.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2434,6 +2438,9 @@ fi
# '-' | |
# '-'
%changelog
+* Fri Jul 06 2012 Justin M. Forbes <jforbes at redhat.com>
+- ACPI, APEI, Avoid too much error reporting in runtime
+
* Fri Jul 6 2012 Peter Robinson <pbrobinson at fedoraproject.org>
- disable TI_CPSW
More information about the scm-commits
mailing list