summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2016-04-18 21:17:23 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2016-04-20 09:09:07 +0100
commite31db4c756879bcd653ff4f36ee3f179c5e333bf (patch)
tree3a00db55987b22f44cefa786afbefa9f0c527f75 /kernel
parentbf16200689118d19de1b8d2a3c314fc21f5dc7bb (diff)
parent9ab9e4fce45379cb6a7dbf87cf8f8e6ba01853c2 (diff)
downloadop-kernel-dev-e31db4c756879bcd653ff4f36ee3f179c5e333bf.zip
op-kernel-dev-e31db4c756879bcd653ff4f36ee3f179c5e333bf.tar.gz
Merge tag 'arm-memremap-for-v4.7' of git://git.linaro.org/people/ard.biesheuvel/linux-arm into devel-stable
This series wires up the generic memremap() function for ARM in a way that allows it to be used as intended, i.e., without regard for whether the region being mapped is covered by a struct page and/or the linear mapping (lowmem)
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memremap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c
index a6d3823..0175321 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -27,6 +27,13 @@ __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
}
#endif
+#ifndef arch_memremap_wb
+static void *arch_memremap_wb(resource_size_t offset, unsigned long size)
+{
+ return (__force void *)ioremap_cache(offset, size);
+}
+#endif
+
static void *try_ram_remap(resource_size_t offset, size_t size)
{
unsigned long pfn = PHYS_PFN(offset);
@@ -34,7 +41,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
/* In the simple case just return the existing linear address */
if (pfn_valid(pfn) && !PageHighMem(pfn_to_page(pfn)))
return __va(offset);
- return NULL; /* fallback to ioremap_cache */
+ return NULL; /* fallback to arch_memremap_wb */
}
/**
@@ -90,7 +97,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
if (is_ram == REGION_INTERSECTS)
addr = try_ram_remap(offset, size);
if (!addr)
- addr = ioremap_cache(offset, size);
+ addr = arch_memremap_wb(offset, size);
}
/*
OpenPOWER on IntegriCloud