Received: by 10.223.185.116 with SMTP id b49csp6023775wrg; Thu, 8 Mar 2018 00:04:22 -0800 (PST) X-Google-Smtp-Source: AG47ELuyo351dQwl4IuzhRxcYipWozbsfbGk2Vpm5Ga2uEP4Hg8VA526TVb+CjWMZSwwgQpEDiF+ X-Received: by 2002:a17:902:9002:: with SMTP id a2-v6mr23083849plp.412.1520496262137; Thu, 08 Mar 2018 00:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496262; cv=none; d=google.com; s=arc-20160816; b=IlT1xTMsTlo/qswK7cvaUJRWI9DygWF5Ntf83vz9aXU1EISq5zm6dUWkodeXevoMRh iTr205RrhD+EQ9/4RMgEHz1mu7Ff2ILE7Vk30g1FegB73FH3B6RgOc5ynB+IHx7dvgt9 xv2oz4MlkQKYlbOWBb4nJXnOWwAqkPNZt39XswCQTAERnMAhCefYn2roSxl6ioQS9rrG 5F5p+LyIhYY2yH9KYugKtfPpcvoJkmRnqg96jh3pBTsMkN3D3z+5uYpV1813VCoHP0oQ Hh97RhXaCdyr9k1lGzpYVnxfCV6uKjHNM8xxsnrkduTuX+20WH4DyV54DEnkFO0MeVDW AOdQ== 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=/VS1eMqAKOvzHYMSXdeRKhYt4fFw3teK9uqsKXoRHIk=; b=iQ/oVZQ0/h0r/ulbtxGkPk+kKkQWDcEX/PtvMo/AsWLnYS3zuJ2mKD2BqG9xyIfSMA rqg2LOgHXiq93URLPD5q10r4bjfjisgkuPZEtYQwKV9vtaohdVPUhHNfjGf9QEXwB3pd lJk85lKMWeU4IPyxrwpP7n9o9HrSyPCVXYdOJmn/ICW4qAMyc06yx+yKpFpfyRWbDNIc nb0J0qT18DPeC9XnKpON62sRWqnfg2CxVTbprV/EeLUyLedbND0qzKQtOV73bJgDyVK3 EdaJdGF+lQlrjPw0sHdMQwhw5n/sHZ9mPJV0txNVcS3LLKQLXFlu4N46KvYivFENJnWD Mt1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQgBxuDZ; 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; dmarc=pass (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 59-v6si14525765plf.596.2018.03.08.00.04.07; Thu, 08 Mar 2018 00:04:22 -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; dkim=pass header.i=@linaro.org header.s=google header.b=SQgBxuDZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965656AbeCHICu (ORCPT + 99 others); Thu, 8 Mar 2018 03:02:50 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36317 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965572AbeCHICU (ORCPT ); Thu, 8 Mar 2018 03:02:20 -0500 Received: by mail-wm0-f67.google.com with SMTP id 188so9279383wme.1 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=q0GXqGygrtwj6reSFRkrZMnlH60M9T23Advwyu3UCJUVX1nBFgfzfYKCB/Kovn9kyX mg0Q1T7JGzKfFPJ+7RGGfSXRuk2nxWPi1y1BmK0HoyGhDRD4K/ISeHtTI+/AFrj09kvq dRxFpLbMebaodYJ+cY8Ja7r20+L62Qep25GCbNjvfc1t1GcgWhFAwBjvkhmyiEVnLZ/q 3zx7ETaaDIOL2qmE0U6xdHd5THdVM1tAM12r/EYWC92gxn2dZV+BMKkrYvrqsn8ot9tB nuDieOu8iHi4GuBCVgmdxuX50/mhCRMuDFRYN6EFapEgs15I8DAohS6FV0OBNHA9plAN 59ZA== X-Gm-Message-State: AElRT7G6rZBzgkH3ABZVwKOSUfCuXqY4zbqhHGvPmatkhRe68IiiQZ9O wSB/Djoex1BE5cKDLT2dTULTEA== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.15.1