]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPI, APEI: Fixup common access width firmware bug
authorJean Delvare <jdelvare@suse.de>
Tue, 12 Jun 2012 08:43:28 +0000 (10:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:22:54 +0000 (08:22 -0700)
commit f712c71f7b2b43b894d1e92e1b77385fcad8815f upstream.

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 <jdelvare@suse.de>
Acked-by: Huang Ying <ying.huang@intel.com>
Acked-by: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/apei/apei-base.c

index 6686b1eaf13e5fdd7e9ce6813717d7fcbbf5c2be..00a783661d0b5548b65882f312faa4a116ff5762 100644 (file)
@@ -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",