ARM: dma-mapping: remove custom consistent dma region

This patch changes dma-mapping subsystem to use generic vmalloc areas
for all consistent dma allocations. This increases the total size limit
of the consistent allocations and removes platform hacks and a lot of
duplicated code.

Atomic allocations are served from special pool preallocated on boot,
because vmalloc areas cannot be reliably created in atomic context.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
This commit is contained in:
Marek Szyprowski
2012-07-30 09:11:33 +02:00
parent 5e6cafc83e
commit e9da6e9905
6 changed files with 188 additions and 330 deletions
+1 -1
View File
@@ -526,7 +526,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
coherent_pool=nn[KMG] [ARM,KNL] coherent_pool=nn[KMG] [ARM,KNL]
Sets the size of memory pool for coherent, atomic dma Sets the size of memory pool for coherent, atomic dma
allocations if Contiguous Memory Allocator (CMA) is used. allocations, by default set to 256K.
code_bytes [X86] How many bytes of object code to print code_bytes [X86] How many bytes of object code to print
in an oops report. in an oops report.
+1 -1
View File
@@ -226,7 +226,7 @@ static inline int dma_mmap_writecombine(struct device *dev, struct vm_area_struc
* DMA region above it's default value of 2MB. It must be called before the * DMA region above it's default value of 2MB. It must be called before the
* memory allocator is initialised, i.e. before any core_initcall. * memory allocator is initialised, i.e. before any core_initcall.
*/ */
extern void __init init_consistent_dma_size(unsigned long size); static inline void init_consistent_dma_size(unsigned long size) { }
/* /*
* For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic" * For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic"
+173 -327
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -59,6 +59,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
#define VM_ARM_MTYPE(mt) ((mt) << 20) #define VM_ARM_MTYPE(mt) ((mt) << 20)
#define VM_ARM_MTYPE_MASK (0x1f << 20) #define VM_ARM_MTYPE_MASK (0x1f << 20)
/* consistent regions used by dma_alloc_attrs() */
#define VM_ARM_DMA_CONSISTENT 0x20000000
#endif #endif
#ifdef CONFIG_ZONE_DMA #ifdef CONFIG_ZONE_DMA
+1
View File
@@ -93,6 +93,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size,
unsigned long start, unsigned long end, unsigned long start, unsigned long end,
const void *caller); const void *caller);
extern struct vm_struct *remove_vm_area(const void *addr); extern struct vm_struct *remove_vm_area(const void *addr);
extern struct vm_struct *find_vm_area(const void *addr);
extern int map_vm_area(struct vm_struct *area, pgprot_t prot, extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
struct page ***pages); struct page ***pages);
+9 -1
View File
@@ -1403,7 +1403,15 @@ struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
-1, GFP_KERNEL, caller); -1, GFP_KERNEL, caller);
} }
static struct vm_struct *find_vm_area(const void *addr) /**
* find_vm_area - find a continuous kernel virtual area
* @addr: base address
*
* Search for the kernel VM area starting at @addr, and return it.
* It is up to the caller to do all required locking to keep the returned
* pointer valid.
*/
struct vm_struct *find_vm_area(const void *addr)
{ {
struct vmap_area *va; struct vmap_area *va;