aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2005-09-03 18:54:58 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:05:46 -0400
commitfd195c49fb17a21e232f50bddb2267150053cf34 (patch)
treeab9370a3d351eb7594e5086ae8d3aa5401a1e375
parent9b4ee40ebbbaf3f8c775b023d89ceedda1167d79 (diff)
[PATCH] arm: allow for arch-specific IOREMAP_MAX_ORDER
Version 6 of the ARM architecture introduces the concept of 16MB pages (supersections) and 36-bit (40-bit actually, but nobody uses this) physical addresses. 36-bit addressed memory and I/O and ARMv6 can only be mapped using supersections and the requirement on these is that both virtual and physical addresses be 16MB aligned. In trying to add support for ioremap() of 36-bit I/O, we run into the issue that get_vm_area() allows for a maximum of 512K alignment via the IOREMAP_MAX_ORDER constant. To work around this, we can: - Allocate a larger VM area than needed (size + (1ul << IOREMAP_MAX_ORDER)) and then align the pointer ourselves, but this ends up with 512K of wasted VM per ioremap(). - Provide a new __get_vm_area_aligned() API and make __get_vm_area() sit on top of this. I did this and it works but I don't like the idea adding another VM API just for this one case. - My preferred solution which is to allow the architecture to override the IOREMAP_MAX_ORDER constant with it's own version. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--mm/vmalloc.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 6409d9cf5965..b244f69ef682 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -10,6 +10,14 @@
10#define VM_MAP 0x00000004 /* vmap()ed pages */ 10#define VM_MAP 0x00000004 /* vmap()ed pages */
11/* bits [20..32] reserved for arch specific ioremap internals */ 11/* bits [20..32] reserved for arch specific ioremap internals */
12 12
13/*
14 * Maximum alignment for ioremap() regions.
15 * Can be overriden by arch-specific value.
16 */
17#ifndef IOREMAP_MAX_ORDER
18#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */
19#endif
20
13struct vm_struct { 21struct vm_struct {
14 void *addr; 22 void *addr;
15 unsigned long size; 23 unsigned long size;
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 8ff16a1eee6a..67b358e57ef6 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -158,8 +158,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
158 return err; 158 return err;
159} 159}
160 160
161#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */
162
163struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 161struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
164 unsigned long start, unsigned long end) 162 unsigned long start, unsigned long end)
165{ 163{