diff options
author | Len Brown <len.brown@intel.com> | 2011-01-06 19:46:40 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-07 01:04:19 -0500 |
commit | 6d5bbf00d251cc73223a71422d69e069dc2e0b8d (patch) | |
tree | 78088b56bbc95caff8cfa574941710e0c065b596 | |
parent | ca9b600be38c73b7d25acfb8b7e4e9a9e941d881 (diff) |
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: Jack Steiner <steiner@sgi.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | arch/ia64/include/asm/io.h | 5 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h index cc8335eb3110..e5a6c3530c6c 100644 --- a/arch/ia64/include/asm/io.h +++ b/arch/ia64/include/asm/io.h | |||
@@ -426,6 +426,11 @@ extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size) | |||
426 | extern void iounmap (volatile void __iomem *addr); | 426 | extern void iounmap (volatile void __iomem *addr); |
427 | extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size); | 427 | extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size); |
428 | extern void early_iounmap (volatile void __iomem *addr, unsigned long size); | 428 | extern void early_iounmap (volatile void __iomem *addr, unsigned long size); |
429 | static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned long size) | ||
430 | { | ||
431 | return ioremap(phys_addr, size); | ||
432 | } | ||
433 | |||
429 | 434 | ||
430 | /* | 435 | /* |
431 | * String version of IO memory access ops: | 436 | * String version of IO memory access ops: |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 055d7b701fff..3a7b4879fd99 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -320,7 +320,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size) | |||
320 | 320 | ||
321 | pg_off = round_down(phys, PAGE_SIZE); | 321 | pg_off = round_down(phys, PAGE_SIZE); |
322 | pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; | 322 | pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; |
323 | virt = ioremap(pg_off, pg_sz); | 323 | virt = ioremap_cache(pg_off, pg_sz); |
324 | if (!virt) { | 324 | if (!virt) { |
325 | kfree(map); | 325 | kfree(map); |
326 | return NULL; | 326 | return NULL; |
@@ -642,7 +642,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) | |||
642 | virt_addr = acpi_map_vaddr_lookup(phys_addr, size); | 642 | virt_addr = acpi_map_vaddr_lookup(phys_addr, size); |
643 | rcu_read_unlock(); | 643 | rcu_read_unlock(); |
644 | if (!virt_addr) { | 644 | if (!virt_addr) { |
645 | virt_addr = ioremap(phys_addr, size); | 645 | virt_addr = ioremap_cache(phys_addr, size); |
646 | unmap = 1; | 646 | unmap = 1; |
647 | } | 647 | } |
648 | if (!value) | 648 | if (!value) |
@@ -678,7 +678,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) | |||
678 | virt_addr = acpi_map_vaddr_lookup(phys_addr, size); | 678 | virt_addr = acpi_map_vaddr_lookup(phys_addr, size); |
679 | rcu_read_unlock(); | 679 | rcu_read_unlock(); |
680 | if (!virt_addr) { | 680 | if (!virt_addr) { |
681 | virt_addr = ioremap(phys_addr, size); | 681 | virt_addr = ioremap_cache(phys_addr, size); |
682 | unmap = 1; | 682 | unmap = 1; |
683 | } | 683 | } |
684 | 684 | ||