From: Myron Stowe Date: Thu, 21 Oct 2010 20:23:48 +0000 (-0600) Subject: ACPI: Fix ioremap size for MMIO reads and writes X-Git-Tag: v2.6.37-rc1~100^2~1^2~5 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b3ba1efec2a58f4dc0647f4c0099c27d6ab92595;p=~emulex%2Finfiniband.git ACPI: Fix ioremap size for MMIO reads and writes The size used for I/O remapping MMIO read and write accesses has not accounted for the basis of ACPI's Generic Address Structure (GAS) 'Register Bit Width' field which is bits, not bytes. This patch adjusts the ioremap() 'size' argument accordingly. ACPI "Generic Register" reference: ACPI Specification, Revision 4.0, Section 5.2.3.1, "Generic Address Structure". Signed-off-by: Myron Stowe Signed-off-by: Len Brown --- diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 65b25a303b8..58842fb9fd9 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -496,7 +496,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) u32 dummy; void __iomem *virt_addr; - virt_addr = ioremap(phys_addr, width); + virt_addr = ioremap(phys_addr, width / 8); if (!value) value = &dummy; @@ -524,7 +524,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) { void __iomem *virt_addr; - virt_addr = ioremap(phys_addr, width); + virt_addr = ioremap(phys_addr, width / 8); switch (width) { case 8: