Thread (57 messages) 57 messages, 5 authors, 2012-07-25
STALE5111d REVIEWED: 2 (0M)

[PATCH 30/52] ACPI, APEI: Fixup common access width firmware bug

From: Len Brown <lenb@kernel.org>
Date: 2012-07-25 03:41:26
Also in: linux-pm
Subsystem: acpi, acpi apei, the rest · Maintainers: "Rafael J. Wysocki", Linus Torvalds

From: Jean Delvare <redacted>

Many firmwares have a common register definition bug where 8-bit
access width is specified for a 32-bit register. Ideally this should
be fixed in the BIOS, but earlier versions of the kernel did not
complain, so fix that up silently.

This closes kernel bug #43282:
https://bugzilla.kernel.org/show_bug.cgi?id=43282

Signed-off-by: Jean Delvare <redacted>
Acked-by: Huang Ying <redacted>
Acked-by: Gary Hade <redacted>
Cc: stable@vger.kernel.org [3.4+]
Signed-off-by: Len Brown <redacted>
---
 drivers/acpi/apei/apei-base.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 6686b1e..00a7836 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -586,6 +586,11 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
 	}
 	*access_bit_width = 1UL << (access_size_code + 2);
 
+	/* Fixup common BIOS bug */
+	if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 &&
+	    *access_bit_width < 32)
+		*access_bit_width = 32;
+
 	if ((bit_width + bit_offset) > *access_bit_width) {
 		pr_warning(FW_BUG APEI_PFX
 			   "Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n",
-- 
1.7.12.rc0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help