From patchwork Wed Mar 11 12:39:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 45634 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 CAA31214C6 for ; Wed, 11 Mar 2015 12:41:26 +0000 (UTC) Received: by wevk48 with SMTP id k48sf6430595wev.0 for ; Wed, 11 Mar 2015 05:41:26 -0700 (PDT) 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=07Fq57xq7RahDtfdx3jNJE8W5BB+K2JgMEwTZrMZz14=; b=P2QugqNpjnRKG4W60TrP93J7cIZtbYNRP+S83qUrSKKKXCSf/rosckSbOaCvxo2fzs 0+/rIhnZsISsPox7QmP0pCr0iUKrKG/wyRJsiwjNg4H8pV+9XHbrra2YR7fCMUNOC0NH ePFrK17OoCpGwA97DKLIvtE/EFEP7Sb0s8xzCMmoI43Dnvm8rMe69BbqH0OwqtRT+LMZ olbDn/91vxy2J7XqXHfLq9Tw0I8xg+kWn0329cP1mqofmvz7kVO8wVITDerfcoRDSlA6 3pkRWcBWRb43FB/LlDQS8GWIGcICfgy6WQFM16f+fIfuDXAkbUKscv1Xuxpp8WyNE1Iu qhTw== X-Gm-Message-State: ALoCoQlUtbngG46MW8Hu0DPnZmaQ4cmyoSocWAZ4G02w2dgU0vfhnYEmgSnbrxjPpNnTrgbsof3C X-Received: by 10.112.130.70 with SMTP id oc6mr5604598lbb.13.1426077686111; Wed, 11 Mar 2015 05:41:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.75 with SMTP id da11ls136983lad.95.gmail; Wed, 11 Mar 2015 05:41:25 -0700 (PDT) X-Received: by 10.152.8.52 with SMTP id o20mr6201493laa.4.1426077685915; Wed, 11 Mar 2015 05:41:25 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id rt5si2216067lac.158.2015.03.11.05.41.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 05:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbiz12 with SMTP id z12so8525562lbi.5 for ; Wed, 11 Mar 2015 05:41:25 -0700 (PDT) X-Received: by 10.112.185.66 with SMTP id fa2mr33816644lbc.117.1426077685819; Wed, 11 Mar 2015 05:41:25 -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.35.133 with SMTP id h5csp2751642lbj; Wed, 11 Mar 2015 05:41:24 -0700 (PDT) X-Received: by 10.66.184.106 with SMTP id et10mr79735195pac.138.1426077680807; Wed, 11 Mar 2015 05:41:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ks9si6739044pab.194.2015.03.11.05.41.19; Wed, 11 Mar 2015 05:41:20 -0700 (PDT) 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 S1752909AbbCKMlQ (ORCPT + 28 others); Wed, 11 Mar 2015 08:41:16 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:42146 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752812AbbCKMlI (ORCPT ); Wed, 11 Mar 2015 08:41:08 -0400 Received: by pdbfl12 with SMTP id fl12so10940909pdb.9 for ; Wed, 11 Mar 2015 05:41:07 -0700 (PDT) X-Received: by 10.70.54.130 with SMTP id j2mr55742654pdp.122.1426077667571; Wed, 11 Mar 2015 05:41:07 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id oq4sm5886557pdb.73.2015.03.11.05.41.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Mar 2015 05:41:06 -0700 (PDT) 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 v10 05/21] ACPI: fix acpi_os_ioremap for arm64 Date: Wed, 11 Mar 2015 20:39:31 +0800 Message-Id: <1426077587-1561-6-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426077587-1561-1-git-send-email-hanjun.guo@linaro.org> References: <1426077587-1561-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.178 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 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);