Commit 6d5bbf00 authored by Len Brown's avatar Len Brown

ACPI: Use ioremap_cache()

Although the temporary boot-time ACPI table mappings
were set up with CPU caching enabled, the permanent table
mappings and AML run-time region memory accesses were
set up with ioremap(), which on x86 is a synonym for
ioremap_nocache().

Changing this to ioremap_cache() improves performance as
seen when accessing the tables via acpidump,
or /sys/firmware/acpi/tables.  It should also improve
AML run-time performance.

No change on ia64.
Reported-by: default avatarJack Steiner <steiner@sgi.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent ca9b600b
...@@ -426,6 +426,11 @@ extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size) ...@@ -426,6 +426,11 @@ extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size)
extern void iounmap (volatile void __iomem *addr); extern void iounmap (volatile void __iomem *addr);
extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size); extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size);
extern void early_iounmap (volatile void __iomem *addr, unsigned long size); extern void early_iounmap (volatile void __iomem *addr, unsigned long size);
static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned long size)
{
return ioremap(phys_addr, size);
}
/* /*
* String version of IO memory access ops: * String version of IO memory access ops:
......
...@@ -320,7 +320,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size) ...@@ -320,7 +320,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
pg_off = round_down(phys, PAGE_SIZE); pg_off = round_down(phys, PAGE_SIZE);
pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
virt = ioremap(pg_off, pg_sz); virt = ioremap_cache(pg_off, pg_sz);
if (!virt) { if (!virt) {
kfree(map); kfree(map);
return NULL; return NULL;
...@@ -642,7 +642,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) ...@@ -642,7 +642,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
virt_addr = acpi_map_vaddr_lookup(phys_addr, size); virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
rcu_read_unlock(); rcu_read_unlock();
if (!virt_addr) { if (!virt_addr) {
virt_addr = ioremap(phys_addr, size); virt_addr = ioremap_cache(phys_addr, size);
unmap = 1; unmap = 1;
} }
if (!value) if (!value)
...@@ -678,7 +678,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) ...@@ -678,7 +678,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
virt_addr = acpi_map_vaddr_lookup(phys_addr, size); virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
rcu_read_unlock(); rcu_read_unlock();
if (!virt_addr) { if (!virt_addr) {
virt_addr = ioremap(phys_addr, size); virt_addr = ioremap_cache(phys_addr, size);
unmap = 1; unmap = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment