From patchwork Fri Sep 9 15:18:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 75903 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp402940qgf; Fri, 9 Sep 2016 08:23:52 -0700 (PDT) X-Received: by 10.98.56.207 with SMTP id f198mr7547399pfa.83.1473434632033; Fri, 09 Sep 2016 08:23:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gk9si4315336pac.182.2016.09.09.08.23.51; Fri, 09 Sep 2016 08:23:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754212AbcIIPXl (ORCPT + 27 others); Fri, 9 Sep 2016 11:23:41 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38151 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbcIIPTK (ORCPT ); Fri, 9 Sep 2016 11:19:10 -0400 Received: by mail-wm0-f44.google.com with SMTP id 1so38965811wmz.1 for ; Fri, 09 Sep 2016 08:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vuP8OxEyH5tctiyRRqb+9Vm48116jVZSZ6bSdslemcc=; b=lEdNl/cCaRkHoaklehS5wnElVfuEKLg5wGjqx75xuAlBanx8TFcqkIWgpwRVnisbOO OVNUP/LBPvyuNkEAI6HmaHA5QYiTBXH+w7qD8FxLve5tZHV30uPtl62qkA6Bj7NUlCcY hZCWCAT7jHIybfu2fohlIGbr1hWP7THkeDhcVi2IjDPdEH4wcd9FzYL4H6NRwjBS6w0F gxHOyv0v8Q4RvINPzDoIBkk5bZ7myWxM5mOX+1hFKItw5/9I+N2VhQ7JOny14zvn/CSm O88JHp2AFnGgORjW94PQzo20TMG82sxKm79qrCuYLvu9FA5wx/cEOnzu8TwkDBPiEpnw bINA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vuP8OxEyH5tctiyRRqb+9Vm48116jVZSZ6bSdslemcc=; b=DLhj73fzNQT+dNgnegtA9NdWFB0m5S70EWs7xrnglIotVWc6ZOz1r1LTgEDd/A13Hh RtAijBgkTJJwTis8QeQMbylOLt+pSvInFqT2K3kItCGTVMq52cNqEP0En30vyP3lrc+R ZQKW0XatZ66RdvfUw9KgO00M0viX9yiM7JoCqmz4TeFbwmNbc8jGEhbIg9xlxBeowlHl slxLYhgjtGmUbnKGT/SDVmUEXMaJzvHoBgeV7DaCv8BzFUlfCAoK6txEmsUcr8B3ARkV ZMwiV9KT02rVfomtc1v0ma9JhLJshmX78O4AEM97T19qBdAv8MLEplK02VlhAFIq41Ug R4gA== X-Gm-Message-State: AE9vXwM/yCrhbv+z+HJc13ZRbJ/Fdk4R2TLeR72/ySE0jx8wDWO8iH6BaQFFN1DRMtIXtg== X-Received: by 10.28.41.6 with SMTP id p6mr3439818wmp.18.1473434348738; Fri, 09 Sep 2016 08:19:08 -0700 (PDT) Received: from localhost ([2a02:c7f:9225:4100:de53:60ff:fe39:5599]) by smtp.gmail.com with ESMTPSA id 190sm3853171wmk.13.2016.09.09.08.19.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 08:19:08 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Leif Lindholm , Mark Rutland , Peter Jones Subject: [PATCH 12/29] efi/esrt: Use memremap not ioremap to access ESRT table in memory Date: Fri, 9 Sep 2016 16:18:34 +0100 Message-Id: <20160909151851.27577-13-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909151851.27577-1-matt@codeblueprint.co.uk> References: <20160909151851.27577-1-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel On ARM and arm64, ioremap() and memremap() are not interchangeable like on x86, and the use of ioremap() on ordinary RAM is typically flagged as an error if the memory region being mapped is also covered by the linear mapping, since that would lead to aliases with conflicting cacheability attributes. Since what we are dealing with is not an I/O region with side effects, using ioremap() here is arguably incorrect anyway, so let's replace it with memremap() instead. Acked-by: Peter Jones Signed-off-by: Ard Biesheuvel Cc: Leif Lindholm Cc: Mark Rutland Signed-off-by: Matt Fleming --- drivers/firmware/efi/esrt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.9.3 diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index b93cd11f9bcc..14914074f716 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -387,9 +388,9 @@ static int __init esrt_sysfs_init(void) if (!esrt_data || !esrt_data_size) return -ENOSYS; - esrt = ioremap(esrt_data, esrt_data_size); + esrt = memremap(esrt_data, esrt_data_size, MEMREMAP_WB); if (!esrt) { - pr_err("ioremap(%pa, %zu) failed.\n", &esrt_data, + pr_err("memremap(%pa, %zu) failed.\n", &esrt_data, esrt_data_size); return -ENOMEM; }