From patchwork Wed Feb 25 08:39:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 45014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 143D720502 for ; Wed, 25 Feb 2015 08:42:03 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf2214409wiv.3 for ; Wed, 25 Feb 2015 00:42:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=h1sEr/o7qOKyUu6Bku2FDMkgm8kAxqtBR8nd0AWrod4=; b=I9Jacfa+FYEvhsnqE6xBc8nHbay3zLzdzjMFRlx3N8ZODDQ1lZWS2TouuT+U+ayzS9 +9ZiPtBpFC10vS86BLHRgvQ5etFmiToZk2bRPWdlbS9KB33PKS1p61e50BnHu5ZxOurZ RQGZSHX9aMUf8Mefinbx71ZLUyur6FdV+Gu6FzKZs00MH+htvO3R55+M2rFgjHzHdPMB 2upi4gc8EKqVr1PkS0cHfhIgUMPFsTL5ZOEprEBiFIzQgvICh3YY6V/CV4ckLQ1UYPA/ Y/VJacrhgCjZmJX7D3CXhdCAzT6aJN9++DKyf/qmr9fVjArh+VnxRXc69C5F8XIOlxvp +FEQ== X-Gm-Message-State: ALoCoQnoDe6wYVZ+UMuia6DFge6CC3smotQGitfxOVNB9kbTJ5mUU94qCxTWVHY9Qh4VeU4KOZ4C X-Received: by 10.152.45.7 with SMTP id i7mr274168lam.9.1424853722379; Wed, 25 Feb 2015 00:42:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.65 with SMTP id b1ls774504laf.99.gmail; Wed, 25 Feb 2015 00:42:01 -0800 (PST) X-Received: by 10.152.29.166 with SMTP id l6mr1833264lah.78.1424853721928; Wed, 25 Feb 2015 00:42:01 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id b5si25284430laf.90.2015.02.25.00.42.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 00:42:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbvp9 with SMTP id p9so2362063lbv.0 for ; Wed, 25 Feb 2015 00:42:01 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr1781687lab.106.1424853721653; Wed, 25 Feb 2015 00:42:01 -0800 (PST) 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.35.133 with SMTP id h5csp2475500lbj; Wed, 25 Feb 2015 00:42:00 -0800 (PST) X-Received: by 10.66.66.166 with SMTP id g6mr3758216pat.88.1424853719907; Wed, 25 Feb 2015 00:41:59 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nu4si1606626pdb.191.2015.02.25.00.41.55; Wed, 25 Feb 2015 00:41:59 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753160AbbBYIlp (ORCPT + 28 others); Wed, 25 Feb 2015 03:41:45 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:38176 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbbBYIln (ORCPT ); Wed, 25 Feb 2015 03:41:43 -0500 Received: by padbj1 with SMTP id bj1so3636170pad.5 for ; Wed, 25 Feb 2015 00:41:42 -0800 (PST) X-Received: by 10.68.211.228 with SMTP id nf4mr3762306pbc.66.1424853702573; Wed, 25 Feb 2015 00:41:42 -0800 (PST) Received: from localhost ([167.160.116.82]) by mx.google.com with ESMTPSA id fc6sm11131505pab.6.2015.02.25.00.41.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Feb 2015 00:41:41 -0800 (PST) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Olof Johansson , Grant Likely Cc: 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 , Hanjun Guo Subject: [PATCH v9 06/21] ACPI: fix acpi_os_ioremap for arm64 Date: Wed, 25 Feb 2015 16:39:46 +0800 Message-Id: <1424853601-6675-7-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.217.176 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Grant Likely --- 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);