Skip to content

Commit

Permalink
ACPI: Fix ioremap size for MMIO reads and writes
Browse files Browse the repository at this point in the history
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 <myron.stowe@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Myron Stowe authored and Len Brown committed Oct 25, 2010
1 parent f6f94e2 commit b3ba1ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b3ba1ef

Please sign in to comment.