From: Dan Williams <dan.j.williams@intel.com>
To: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com
Cc: linux-arch@vger.kernel.org, toshi.kani@hp.com,
linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org,
rmk+kernel@arm.linux.org.uk, hch@lst.de,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 09/25] arm: switch from ioremap_cache to memremap
Date: Fri, 24 Jul 2015 22:38:48 -0400 [thread overview]
Message-ID: <20150725023848.8664.36275.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <20150725023649.8664.59145.stgit@dwillia2-desk3.amr.corp.intel.com>
In preparation for deprecating ioremap_cache() convert its usage in
arch/arm[64]/ to memremap.
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
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 1bee8ca12494..59c966e51af7 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_CACHE)
+#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 406485ed110a..5d7e46a1efdb 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_CACHE);
}
#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..f3dae56c50da 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_CACHE)
+#define dmi_early_unmap(x, l) memunmap(x)
+#define dmi_remap(x, l) memremap(x, l, MEMREMAP_CACHE)
+#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 9d4aa18f2a82..f0d6688cd62c 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -26,6 +26,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/efi.h>
@@ -290,8 +291,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_CACHE);
if (!memmap.map) {
pr_err("Failed to remap EFI memory map\n");
return -1;
@@ -299,8 +300,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_CACHE);
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..47da614f6215 100644
--- a/arch/arm64/kernel/smp_spin_table.c
+++ b/arch/arm64/kernel/smp_spin_table.c
@@ -21,11 +21,11 @@
#include <linux/of.h>
#include <linux/smp.h>
#include <linux/types.h>
+#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/cpu_ops.h>
#include <asm/cputype.h>
-#include <asm/io.h>
#include <asm/smp_plat.h>
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_CACHE);
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;
}
next prev parent reply other threads:[~2015-07-25 2:49 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-25 2:37 [PATCH v2 00/25] replace ioremap_{cache|wt} with memremap Dan Williams
2015-07-25 2:38 ` [PATCH v2 01/25] mm, x86: Fix warning in ioremap RAM check Dan Williams
2015-07-25 2:38 ` [PATCH v2 02/25] mm, x86: Remove region_is_ram() call from ioremap Dan Williams
2015-07-25 2:38 ` [PATCH v2 03/25] mm: Fix bugs in region_is_ram() Dan Williams
2015-07-25 2:38 ` [PATCH v2 04/25] mm: enhance region_is_ram() to distinguish 'unknown' vs 'mixed' Dan Williams
2015-07-27 22:50 ` Luis R. Rodriguez
2015-07-28 21:33 ` Toshi Kani
2015-07-25 2:38 ` [PATCH v2 05/25] arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead Dan Williams
2015-07-25 2:38 ` [PATCH v2 06/25] cleanup IORESOURCE_CACHEABLE vs ioremap() Dan Williams
2015-07-25 2:38 ` [PATCH v2 07/25] intel_iommu: fix leaked ioremap mapping Dan Williams
2015-07-25 2:38 ` [PATCH v2 08/25] arch: introduce memremap() Dan Williams
2015-07-26 17:25 ` Christoph Hellwig
2015-07-26 17:49 ` Dan Williams
2015-07-27 5:12 ` Christoph Hellwig
2015-07-27 5:12 ` Christoph Hellwig
2015-07-27 23:26 ` Dan Williams
2015-07-29 6:50 ` Christoph Hellwig
2015-07-29 18:27 ` Luis R. Rodriguez
2015-07-29 18:33 ` Dan Williams
2015-07-29 21:00 ` Toshi Kani
2015-07-29 21:11 ` Toshi Kani
2015-07-29 21:43 ` Luis R. Rodriguez
2015-07-29 21:47 ` Dan Williams
2015-07-29 21:52 ` Luis R. Rodriguez
2015-07-30 0:00 ` Toshi Kani
2015-08-11 21:30 ` Luis R. Rodriguez
2015-08-11 22:40 ` Toshi Kani
2015-08-11 22:52 ` Luis R. Rodriguez
2015-08-11 23:13 ` Dan Williams
2016-04-21 12:47 ` Luis R. Rodriguez
2015-07-27 23:17 ` Luis R. Rodriguez
2015-07-27 23:31 ` Dan Williams
2015-07-27 23:43 ` Luis R. Rodriguez
2015-07-28 0:32 ` Dan Williams
2015-07-25 2:38 ` Dan Williams [this message]
2015-07-25 2:38 ` [PATCH v2 10/25] x86: switch from ioremap_cache to memremap Dan Williams
2015-07-25 2:38 ` [PATCH v2 11/25] gma500: switch from acpi_os_ioremap to ioremap Dan Williams
2015-07-25 2:39 ` [PATCH v2 12/25] i915: " Dan Williams
2015-07-27 7:50 ` [Intel-gfx] " Daniel Vetter
2015-07-25 2:39 ` [PATCH v2 13/25] acpi: switch from ioremap_cache to memremap Dan Williams
2015-07-25 23:55 ` Rafael J. Wysocki
2015-07-25 2:39 ` [PATCH v2 14/25] toshiba laptop: replace ioremap_cache with ioremap Dan Williams
2015-07-25 2:39 ` [PATCH v2 15/25] memconsole: fix __iomem mishandling, switch to memremap Dan Williams
2015-07-25 22:02 ` Sergei Shtylyov
2015-07-25 2:39 ` [PATCH v2 16/25] visorbus: switch from ioremap_cache " Dan Williams
2015-07-25 2:39 ` [PATCH v2 17/25] intel-iommu: " Dan Williams
2015-08-03 14:27 ` Joerg Roedel
2015-07-25 2:39 ` [PATCH v2 18/25] libnvdimm, pmem: " Dan Williams
2015-07-28 22:51 ` Ross Zwisler
2015-07-28 23:06 ` Dan Williams
2015-07-25 2:39 ` [PATCH v2 19/25] pxa2xx-flash: " Dan Williams
2015-10-02 17:51 ` Brian Norris
2015-10-09 21:33 ` Dan Williams
2015-07-25 2:39 ` [PATCH v2 20/25] sfi: " Dan Williams
2015-07-25 2:39 ` [PATCH v2 21/25] fbdev: switch from ioremap_wt " Dan Williams
2015-07-25 2:40 ` [PATCH v2 22/25] pmem: " Dan Williams
2015-07-29 19:12 ` Ross Zwisler
2015-07-25 2:40 ` [PATCH v2 23/25] arch: remove ioremap_cache, replace with arch_memremap Dan Williams
2015-07-26 17:31 ` Christoph Hellwig
2015-07-25 2:40 ` [PATCH v2 24/25] arch: remove ioremap_wt, " Dan Williams
2015-07-26 17:31 ` Christoph Hellwig
2015-07-27 8:03 ` Christoph Hellwig
2015-07-29 22:21 ` Dan Williams
2015-07-25 2:40 ` [PATCH v2 25/25] pmem: convert to generic memremap Dan Williams
2015-07-26 17:33 ` Christoph Hellwig
2015-07-26 18:11 ` Dan Williams
2015-07-27 5:14 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150725023848.8664.36275.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=hch@lst.de \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=mingo@kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=tglx@linutronix.de \
--cc=toshi.kani@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®