From patchwork Thu Mar 8 08:00:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130974 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6175471lja; Thu, 8 Mar 2018 00:02:49 -0800 (PST) X-Google-Smtp-Source: AG47ELsiNHIVnUZtSEkBaTTMWXkmVlVQG5djJdCxkgALwZPvlPdUg6Ik7K49U7qfg7cKU9XGEwSG X-Received: by 10.99.117.24 with SMTP id q24mr20233397pgc.53.1520496169512; Thu, 08 Mar 2018 00:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496169; cv=none; d=google.com; s=arc-20160816; b=HRmeZpiSd1FJ1TVqv8didMMrt6K4jf3d2aMYPNta3QJ4jZOinr4eyg2/X39T8fPjYq cG4wiAS09bozpqYwqHDMXdH7xz8h7PS6ed1G+37S/RxQETSUNOxnwTRgV8HqEvRo6mOj mnuT09LD9QVvKbuJmv/V5r/kjNvuZPe1d6DiYdj475q0IXM/SM3FFQfsXKaOcI5fzEiK /zmbIy56T9NVf29e9UjnXY+YBCN8I975Qt1HOC+QDyFErotbpaLjXT7QOl4bzZEgqs6p Mj8+fwa/vN0EJPwrFAe1dkQd+taQYN1YkDIMemH2QczgDprjzcPeTt7ymtysPtudMSIr 9nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=a36y9OIXpZ81tPrrB6Z9gpbHv/t6nj082T6eNRHtWqU=; b=jVwmI3MuMFMvTP5WhFI5XdKGouWiOMvyDSC55SpGVzQJsRIBiKecqL6HhkOTHPhkYB iMQqoEiaeoFlUpYgt90A7aeR00+TpmBgln41flZ8p7y/pm0fzhPPoxVqLscB6AcLvFUu Sxsiu1mHS1LV2n2y2Zwz6UiUCciIX4XNU/4wyjYe3x+aRB3rUITxSOF2T4xYz/9PjtPS 0DmiMqc6qS2MsHRzY3w8dUq86bmZf/lWWwxb5F3RFIWDZ1jNQLBSIhLQBT1m40Ch4YRn s9s4aj3CZv/UOYUf4AxUvA2kbD1O14SloHfNqECHcGi0NEV5/DB/QeTT4xwEruauDMjn 7HNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SQgBxuDZ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si12710532pgc.12.2018.03.08.00.02.49; Thu, 08 Mar 2018 00:02:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SQgBxuDZ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755268AbeCHICs (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:48 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35520 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965586AbeCHICV (ORCPT ); Thu, 8 Mar 2018 03:02:21 -0500 Received: by mail-wm0-f66.google.com with SMTP id x7so9289343wmc.0 for ; Thu, 08 Mar 2018 00:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/VS1eMqAKOvzHYMSXdeRKhYt4fFw3teK9uqsKXoRHIk=; b=SQgBxuDZXj0GvS7bc/cbDNTXLLVXRm1rWOmwYnYRAOEjfoRu5E9IUJciH7Q1MeRbi9 1EaGXsIbxKO3GQVkgRX+oMZmS7YjOEDx3w+ISyaQy8kYGWtoB0ocd3Igf/s+Kz/DV+Mw ZRvaiK3vVMaiBExN5eHtTFVs/Hd1dGHApogBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/VS1eMqAKOvzHYMSXdeRKhYt4fFw3teK9uqsKXoRHIk=; b=CLXPGfhtsoYeGjVnYtnIZMB8njROTgqe4iyP6lwNFbL9foFJQeZnmf/hXtS8uaP1xU Wazb3w/+y/qmxHk/C394OGnBLlLkfi0pDVzd7DlfngxPLrEavEs1b2QsNPKzsAqG98jl qNtXu6XHkXEMHa0Z/JO2e9AW24Zx63bKxLEjCVxtQz92S5DiEnYN+pHcVBXhIJ6XVERy Bd5kDHcEJshtWc2Id9aR+P1m38id7zJLTb93AIYZ5Y2hM7DaV/mVyMNOWo52OeNxlaNy 6hOVmOiE1KOEJLNlqEHjEtpxZfgjnzeaQ1nLn4XkrOOS3csVukTy3cKNhmex2rSMKp/U RoFQ== X-Gm-Message-State: AElRT7GYAdorgChVYDSw1wbE07xCUxrBh2Tl5fLhprqMo88ur33nltJt /mSrDRGsXNd7Wh1UUjRHmeEcjcca3Fg= X-Received: by 10.28.87.211 with SMTP id l202mr15296337wmb.32.1520496139695; Thu, 08 Mar 2018 00:02:19 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.02.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:02:18 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Andy Shevchenko , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 11/12] efi/apple-properties: Use memremap() instead of ioremap() Date: Thu, 8 Mar 2018 08:00:19 +0000 Message-Id: <20180308080020.22828-12-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Andy Shevchenko 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(). Signed-off-by: Andy Shevchenko Tested-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/apple-properties.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;