On Fri, 2015-02-20 at 12:11 +0000, Sudeep Holla wrote:
On 18/02/15 13:53, Hanjun Guo wrote:
From: Mark Salter msalter@redhat.com
The acpi_os_ioremap() function may be used to map normal RAM or IO regions. The current implementation simply uses ioremap_cache(). This will work for some architectures, but arm64 ioremap_cache() cannot be used to map IO regions which don't support caching. So for arm64, use ioremap() for non-RAM regions.
CC: Rafael J Wysocki rjw@rjwysocki.net CC: Catalin Marinas catalin.marinas@arm.com Tested-by: Robert Richter rrichter@cavium.com Acked-by: Robert Richter rrichter@cavium.com Signed-off-by: Mark Salter msalter@redhat.com Signed-off-by: Hanjun Guo hanjun.guo@linaro.org
arch/arm64/include/asm/acpi.h | 13 +++++++++++++ include/acpi/acpi_io.h | 4 ++++ 2 files changed, 17 insertions(+)
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 8b837ab..95c95d7 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -12,6 +12,19 @@ #ifndef _ASM_ACPI_H #define _ASM_ACPI_H
+#include <linux/mm.h>
+/* ACPI table mapping after acpi_gbl_permanent_mmap is set */ +static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
acpi_size size)
+{
- if (!page_is_ram(phys >> PAGE_SHIFT))
return ioremap(phys, size);
You may need to include <linux/io.h> for this. I get compilation error with CONFIG_ACPI disabled.
Moving acpi_os_ioremap() inside the #ifdef CONFIG_ACPI will take care of the problem.
- return ioremap_cache(phys, size);
+} +#define acpi_os_ioremap acpi_os_ioremap
[Nit] Any particular reason for not having a different internal name for better readability something like:
#define acpi_os_ioremap __acpi_os_ioremap
Either works. You'll find plenty of other examples in the kernel where
#define foo foo
is used.
Regards, Sudeep
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi