diff options
-rw-r--r-- | kernel/memremap.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c index a6d382312e6f..017532193fb1 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) | |||
27 | } | 27 | } |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #ifndef arch_memremap_wb | ||
31 | static void *arch_memremap_wb(resource_size_t offset, unsigned long size) | ||
32 | { | ||
33 | return (__force void *)ioremap_cache(offset, size); | ||
34 | } | ||
35 | #endif | ||
36 | |||
30 | static void *try_ram_remap(resource_size_t offset, size_t size) | 37 | static void *try_ram_remap(resource_size_t offset, size_t size) |
31 | { | 38 | { |
32 | unsigned long pfn = PHYS_PFN(offset); | 39 | unsigned long pfn = PHYS_PFN(offset); |
@@ -34,7 +41,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size) | |||
34 | /* In the simple case just return the existing linear address */ | 41 | /* In the simple case just return the existing linear address */ |
35 | if (pfn_valid(pfn) && !PageHighMem(pfn_to_page(pfn))) | 42 | if (pfn_valid(pfn) && !PageHighMem(pfn_to_page(pfn))) |
36 | return __va(offset); | 43 | return __va(offset); |
37 | return NULL; /* fallback to ioremap_cache */ | 44 | return NULL; /* fallback to arch_memremap_wb */ |
38 | } | 45 | } |
39 | 46 | ||
40 | /** | 47 | /** |
@@ -90,7 +97,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags) | |||
90 | if (is_ram == REGION_INTERSECTS) | 97 | if (is_ram == REGION_INTERSECTS) |
91 | addr = try_ram_remap(offset, size); | 98 | addr = try_ram_remap(offset, size); |
92 | if (!addr) | 99 | if (!addr) |
93 | addr = ioremap_cache(offset, size); | 100 | addr = arch_memremap_wb(offset, size); |
94 | } | 101 | } |
95 | 102 | ||
96 | /* | 103 | /* |