From patchwork Tue Mar 24 14:02:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46260 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11751214B0 for ; Tue, 24 Mar 2015 14:10:02 +0000 (UTC) Received: by wesq59 with SMTP id q59sf32547261wes.1 for ; Tue, 24 Mar 2015 07:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=ARY9S9k56h4SXMQaMddrAJl5RNtTdo6CEuzZtt3ckzA=; b=jnDwALf/3AqlsPOWUrxetg3AJMrEYXWeZblelWUzZnx4BtKai9KvI4MNLQXtTg1WDG DCL/DsBxISmvPVvZxHj1C7ZdVe22rAnwuMm1JRvmKyEBC7B+i7y9U7nCEkE/Gk4cBfbM w//M+4OMjFSvAi3GwFej8EG/MXuW76VgVnlqWIecXIEoUAl9PnuzMsLR6oDfi5ft3CPx A56qahAZKnyawdGLKFdz2gT7aQ+iYmuVd+5U86NPIrc9NE//mbURrD1uVgvYJqzfd3dG lPbedmiUZdJImNyrX3Vejy0BDiWAK90SJMkSebw9RaryQQ0UuzQHc4EB+9/zxK/5SSlB lYGQ== X-Gm-Message-State: ALoCoQnYdAQg4dtV2XIS76UdpXwBJeRT+NFAs8mYIfUy8VWwP/4PrzBB+Ya3RR+ghPrpwd678nuS X-Received: by 10.112.98.38 with SMTP id ef6mr899972lbb.3.1427206201270; Tue, 24 Mar 2015 07:10:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.3 with SMTP id 3ls761527lai.36.gmail; Tue, 24 Mar 2015 07:10:01 -0700 (PDT) X-Received: by 10.152.170.199 with SMTP id ao7mr3850652lac.27.1427206201060; Tue, 24 Mar 2015 07:10:01 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id yj9si3083825lbb.100.2015.03.24.07.10.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 07:10:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagg8 with SMTP id g8so160458496lag.1 for ; Tue, 24 Mar 2015 07:10:01 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr3942178lba.19.1427206200966; Tue, 24 Mar 2015 07:10:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1477268lbq; Tue, 24 Mar 2015 07:09:59 -0700 (PDT) X-Received: by 10.66.102.99 with SMTP id fn3mr8081992pab.118.1427206197719; Tue, 24 Mar 2015 07:09:57 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [198.137.202.9]) by mx.google.com with ESMTPS id n8si5730011pdj.141.2015.03.24.07.09.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 07:09:57 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=198.137.202.9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YaPUw-00063y-76; Tue, 24 Mar 2015 14:08:02 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YaPRU-00037i-Ta for linux-arm-kernel@lists.infradead.org; Tue, 24 Mar 2015 14:04:29 +0000 Received: by pagv19 with SMTP id v19so51748703pag.2 for ; Tue, 24 Mar 2015 07:04:06 -0700 (PDT) X-Received: by 10.66.141.109 with SMTP id rn13mr7650611pab.113.1427205846777; Tue, 24 Mar 2015 07:04:06 -0700 (PDT) Received: from localhost ([180.150.148.224]) by mx.google.com with ESMTPSA id qg7sm4381468pdb.11.2015.03.24.07.04.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Mar 2015 07:04:05 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Olof Johansson , Grant Likely Subject: [patch v11 05/23] ACPI: fix acpi_os_ioremap for arm64 Date: Tue, 24 Mar 2015 22:02:38 +0800 Message-Id: <1427205776-5060-6-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427205776-5060-1-git-send-email-hanjun.guo@linaro.org> References: <1427205776-5060-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150324_070428_993699_D7F50902 X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.46 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.46 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Mark Rutland , Ashwin Chaugule , Lorenzo Pieralisi , Robert Richter , Arnd Bergmann , Graeme Gregory , linaro-acpi@lists.linaro.org, Marc Zyngier , Jon Masters , Timur Tabi , Mark Salter , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Mark Brown , Hanjun Guo , Suravee Suthikulpanit , Sudeep Holla , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Tested-by: Timur Tabi Acked-by: Robert Richter Acked-by: Rafael J. Wysocki Reviewed-by: Grant Likely Signed-off-by: Mark Salter Signed-off-by: Hanjun Guo --- 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);