Received: by 10.223.185.111 with SMTP id b44csp78463wrg; Fri, 9 Mar 2018 01:16:11 -0800 (PST) X-Google-Smtp-Source: AG47ELsWQoxEed7HwCTq1FqNfEo7uxxIdCVF2h95eyDamUXN38GZbvXlP1L2vSNXurMrEqjXiyma X-Received: by 10.101.101.78 with SMTP id a14mr23394703pgw.368.1520586971226; Fri, 09 Mar 2018 01:16:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520586971; cv=none; d=google.com; s=arc-20160816; b=0GSp4N3YUGjAg1OJTyLM8R+VTSJfOOCoZq4XVdZuoj30KTLo8gZqJRnqpG1zLX2mGQ JUTGhIzOy3TxW17463T8Azl/9HjO0b2DyWzX9bVi7XVCsvJQdyPd15NoQEfK0yLJPOwl of0r6nPzpYVrHQ6xa9Ve3IONpCwWj1DbHT0Vco0Hj4bPX5P+X5O3+Xk8ZX1U5SqH5UnE 3WasJlv18Hrk1g1tCudGFdkA8dPvPAluhQbYBYwzV3lWLl4fHRyGCP5LmwpWdBHCw7Jz OhzXqirp5p//1MHfoFBTWgvZMeLoNR/BoGYGuldY8BAKPKL5mZ0sfLok97dZzaBkKS5K bC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=axbXMLocd8ewYCx9+18sldA6U8W0gBdwwDrmdFc7Qbs=; b=a0qjSjVMgwItX7x5qd8hMNwQYmrC9OGrVG6MUOzRTncWHuI2FRHAjHxVWdKZb6Y1D5 rxsnEIlR2PGgk5oeg6plwr/nUHecvxBCpRAjj/u2ljtIkETz8UgNraXqcJdwKjc/yCoY TNl7vg/4lajGCsD1C6pdqxZzZJJJzzYZzZWr0ak2W12ALx54NcTKhuIAw565yk16oNNR qdO1z7ugykx5JFvIZ+fkJe52fnvN8dmwvDcSnvK3cCzFT5SBsVtRshgkjc3teCTGRz5u bxjuIFYXDeI0VWmf1bGmWR9py/j61GOuGwIQbUDW72tYaT6/HhKy6iaWIELi6UY1R9oz xPyA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si504763pla.64.2018.03.09.01.15.56; Fri, 09 Mar 2018 01:16:11 -0800 (PST) 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; 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 S1751835AbeCIJOn (ORCPT + 99 others); Fri, 9 Mar 2018 04:14:43 -0500 Received: from terminus.zytor.com ([198.137.202.136]:42473 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbeCIJOk (ORCPT ); Fri, 9 Mar 2018 04:14:40 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w299EKgd000358; Fri, 9 Mar 2018 01:14:20 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w299EJT5000355; Fri, 9 Mar 2018 01:14:19 -0800 Date: Fri, 9 Mar 2018 01:14:19 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andy Shevchenko Message-ID: Cc: mingo@kernel.org, peterz@infradead.org, lukas@wunner.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, matt@codeblueprint.co.uk, hpa@zytor.com, tglx@linutronix.de, andriy.shevchenko@linux.intel.com, ard.biesheuvel@linaro.org Reply-To: torvalds@linux-foundation.org, lukas@wunner.de, linux-kernel@vger.kernel.org, hpa@zytor.com, matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, tglx@linutronix.de, andriy.shevchenko@linux.intel.com, mingo@kernel.org, peterz@infradead.org In-Reply-To: <20180308080020.22828-12-ard.biesheuvel@linaro.org> References: <20180308080020.22828-12-ard.biesheuvel@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi/apple-properties: Use memremap() instead of ioremap() Git-Commit-ID: 44612d7e0c379001460b37a29721128715bdcb02 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 44612d7e0c379001460b37a29721128715bdcb02 Gitweb: https://git.kernel.org/tip/44612d7e0c379001460b37a29721128715bdcb02 Author: Andy Shevchenko AuthorDate: Thu, 8 Mar 2018 08:00:19 +0000 Committer: Ingo Molnar CommitDate: Fri, 9 Mar 2018 08:58:23 +0100 efi/apple-properties: Use memremap() instead of ioremap() The memory we are accessing through virtual address has no IO side effects. Moreover, for IO memory we have to use special accessors, which we don't use. Due to above, convert the driver to use memremap() instead of ioremap(). Tested-by: Lukas Wunner Signed-off-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180308080020.22828-12-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar --- drivers/firmware/efi/apple-properties.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c index b9602e0d7b50..adaa9a3714b9 100644 --- a/drivers/firmware/efi/apple-properties.c +++ b/drivers/firmware/efi/apple-properties.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -189,7 +190,7 @@ static int __init map_properties(void) pa_data = boot_params.hdr.setup_data; while (pa_data) { - data = ioremap(pa_data, sizeof(*data)); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); if (!data) { pr_err("cannot map setup_data header\n"); return -ENOMEM; @@ -197,14 +198,14 @@ static int __init map_properties(void) if (data->type != SETUP_APPLE_PROPERTIES) { pa_data = data->next; - iounmap(data); + memunmap(data); continue; } data_len = data->len; - iounmap(data); + memunmap(data); - data = ioremap(pa_data, sizeof(*data) + data_len); + data = memremap(pa_data, sizeof(*data) + data_len, MEMREMAP_WB); if (!data) { pr_err("cannot map setup_data payload\n"); return -ENOMEM; @@ -229,7 +230,7 @@ static int __init map_properties(void) * to avoid breaking the chain of ->next pointers. */ data->len = 0; - iounmap(data); + memunmap(data); free_bootmem_late(pa_data + sizeof(*data), data_len); return ret;