From patchwork Fri Oct 9 22:16:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7364631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61EC3BEEA4 for ; Fri, 9 Oct 2015 22:24:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62D5320762 for ; Fri, 9 Oct 2015 22:24:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FAF620760 for ; Fri, 9 Oct 2015 22:24:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zkg44-00022h-35; Fri, 09 Oct 2015 22:23:00 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zkg3I-000108-0Y for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2015 22:22:13 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 09 Oct 2015 15:21:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,660,1437462000"; d="scan'208";a="788865261" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.39]) by orsmga001.jf.intel.com with ESMTP; 09 Oct 2015 15:21:51 -0700 Subject: [PATCH 06/20] arm: switch from ioremap_cache to memremap From: Dan Williams To: linux-kernel@vger.kernel.org Date: Fri, 09 Oct 2015 18:16:09 -0400 Message-ID: <20151009221609.32203.79381.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20151009221537.32203.5867.stgit@dwillia2-desk3.jf.intel.com> References: <20151009221537.32203.5867.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151009_152212_254407_D40717A7 X-CRM114-Status: GOOD ( 15.43 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Russell King , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for deprecating ioremap_cache() convert its usage in arch/arm[64]/ to memremap. Cc: Russell King Signed-off-by: Dan Williams --- arch/arm/include/asm/xen/page.h | 4 ++-- arch/arm64/include/asm/acpi.h | 5 +---- arch/arm64/include/asm/dmi.h | 8 ++++---- arch/arm64/kernel/efi.c | 9 +++++---- arch/arm64/kernel/smp_spin_table.c | 19 +++++++++---------- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h index 127956353b00..91ac751a5baa 100644 --- a/arch/arm/include/asm/xen/page.h +++ b/arch/arm/include/asm/xen/page.h @@ -103,8 +103,8 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn) return __set_phys_to_machine(pfn, mfn); } -#define xen_remap(cookie, size) ioremap_cache((cookie), (size)) -#define xen_unmap(cookie) iounmap((cookie)) +#define xen_remap(cookie, size) memremap((cookie), (size), MEMREMAP_WB) +#define xen_unmap(cookie) memunmap((cookie)) bool xen_arch_need_swiotlb(struct device *dev, unsigned long pfn, diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 208cec08a74f..a24a9b1cc91d 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -33,10 +33,7 @@ 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); + return memremap(phys, size, MEMREMAP_WB); } #define acpi_os_ioremap acpi_os_ioremap diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h index 69d37d87b159..82682d27c6ee 100644 --- a/arch/arm64/include/asm/dmi.h +++ b/arch/arm64/include/asm/dmi.h @@ -22,10 +22,10 @@ * request a virtual mapping for configuration tables such as SMBIOS. * This means we have to map them before use. */ -#define dmi_early_remap(x, l) ioremap_cache(x, l) -#define dmi_early_unmap(x, l) iounmap(x) -#define dmi_remap(x, l) ioremap_cache(x, l) -#define dmi_unmap(x) iounmap(x) +#define dmi_early_remap(x, l) memremap(x, l, MEMREMAP_WB) +#define dmi_early_unmap(x, l) memunmap(x) +#define dmi_remap(x, l) memremap(x, l, MEMREMAP_WB) +#define dmi_unmap(x) memunmap(x) #define dmi_alloc(l) kzalloc(l, GFP_KERNEL) #endif diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 13671a9cf016..7dd05eb2c186 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -291,8 +292,8 @@ static int __init arm64_enable_runtime_services(void) pr_info("Remapping and enabling EFI services.\n"); mapsize = memmap.map_end - memmap.map; - memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, - mapsize); + memmap.map = memremap((phys_addr_t) memmap.phys_map, mapsize, + MEMREMAP_WB); if (!memmap.map) { pr_err("Failed to remap EFI memory map\n"); return -1; @@ -300,8 +301,8 @@ static int __init arm64_enable_runtime_services(void) memmap.map_end = memmap.map + mapsize; efi.memmap = &memmap; - efi.systab = (__force void *)ioremap_cache(efi_system_table, - sizeof(efi_system_table_t)); + efi.systab = memremap(efi_system_table, sizeof(efi_system_table_t), + MEMREMAP_WB); if (!efi.systab) { pr_err("Failed to remap EFI System Table\n"); return -1; diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index aef3605a8c47..2c06c1a36154 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c @@ -21,11 +21,11 @@ #include #include #include +#include #include #include #include -#include #include extern void secondary_holding_pen(void); @@ -73,19 +73,19 @@ static int smp_spin_table_cpu_init(unsigned int cpu) static int smp_spin_table_cpu_prepare(unsigned int cpu) { - __le64 __iomem *release_addr; + __le64 *release_addr; if (!cpu_release_addr[cpu]) return -ENODEV; /* * The cpu-release-addr may or may not be inside the linear mapping. - * As ioremap_cache will either give us a new mapping or reuse the - * existing linear mapping, we can use it to cover both cases. In - * either case the memory will be MT_NORMAL. + * As memremap will either give us a new mapping or reuse the existing + * linear mapping, we can use it to cover both cases. In either case + * the memory will be MT_NORMAL. */ - release_addr = ioremap_cache(cpu_release_addr[cpu], - sizeof(*release_addr)); + release_addr = memremap(cpu_release_addr[cpu], sizeof(*release_addr), + MEMREMAP_WB); if (!release_addr) return -ENOMEM; @@ -97,15 +97,14 @@ static int smp_spin_table_cpu_prepare(unsigned int cpu) * the boot protocol. */ writeq_relaxed(__pa(secondary_holding_pen), release_addr); - __flush_dcache_area((__force void *)release_addr, - sizeof(*release_addr)); + __flush_dcache_area(release_addr, sizeof(*release_addr)); /* * Send an event to wake up the secondary CPU. */ sev(); - iounmap(release_addr); + memunmap(release_addr); return 0; }