From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbbCDWMg (ORCPT ); Wed, 4 Mar 2015 17:12:36 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:60536 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752652AbbCDWMf (ORCPT ); Wed, 4 Mar 2015 17:12:35 -0500 From: "Rafael J. Wysocki" To: Hanjun Guo Cc: Catalin Marinas , Will Deacon , Olof Johansson , Grant Likely , Lorenzo Pieralisi , Arnd Bergmann , Mark Rutland , Graeme Gregory , Sudeep Holla , Jon Masters , Marc Zyngier , Mark Brown , Robert Richter , Timur Tabi , Ashwin Chaugule , suravee.suthikulpanit@amd.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Mark Salter Subject: Re: [PATCH v9 06/21] ACPI: fix acpi_os_ioremap for arm64 Date: Wed, 04 Mar 2015 23:36:11 +0100 Message-ID: <8319080.yo6LBolOJB@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.19.0+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1424853601-6675-7-git-send-email-hanjun.guo@linaro.org> References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> <1424853601-6675-7-git-send-email-hanjun.guo@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, February 25, 2015 04:39:46 PM Hanjun Guo wrote: > From: Mark Salter > > 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 > CC: Catalin Marinas > Tested-by: Robert Richter > Acked-by: Robert Richter > Signed-off-by: Mark Salter > Signed-off-by: Hanjun Guo Acked-by: Rafael J. Wysocki > --- > 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..40e0924 100644 > --- a/arch/arm64/include/asm/acpi.h > +++ b/arch/arm64/include/asm/acpi.h > @@ -12,8 +12,21 @@ > #ifndef _ASM_ACPI_H > #define _ASM_ACPI_H > > +#include > + > /* Basic configuration for ACPI */ > #ifdef CONFIG_ACPI > +/* 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); > + > + return ioremap_cache(phys, size); > +} > +#define acpi_os_ioremap acpi_os_ioremap > + > #define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */ > extern int acpi_disabled; > extern int acpi_noirq; > diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h > index 444671e..dd86c5f 100644 > --- a/include/acpi/acpi_io.h > +++ b/include/acpi/acpi_io.h > @@ -3,11 +3,15 @@ > > #include > > +#include > + > +#ifndef acpi_os_ioremap > static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, > acpi_size size) > { > return ioremap_cache(phys, size); > } > +#endif > > void __iomem *__init_refok > acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.