mm: Move CMA to HIGH Memory

Merge of this patchset: http://comments.gmane.org/gmane.linux.kernel.mm/121810

Change-Id: I1a7006763dbbed72fdff4caff438607d659880a0
This commit is contained in:
Mauro Ribeiro
2014-12-18 14:40:15 -02:00
parent 7cc2fbcab7
commit 983e303c97
2 changed files with 11 additions and 3 deletions

View File

@@ -377,10 +377,9 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
mdesc->reserve();
/*
* reserve memory for DMA contigouos allocations,
* must come from DMA area inside low memory
* reserve memory for DMA contigouos allocations
*/
dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit));
dma_contiguous_reserve(arm_dma_limit);
arm_memblock_steal_permitted = false;
memblock_allow_resize();

View File

@@ -296,6 +296,8 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t *res_base,
{
phys_addr_t base = *res_base;
phys_addr_t alignment;
phys_addr_t memblock_end = memblock_end_of_DRAM();
phys_addr_t highmem_start = __pa(high_memory);
int ret = 0;
pr_debug("%s(size %lx, base %08lx, limit %08lx)\n", __func__,
@@ -311,6 +313,13 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t *res_base,
if (!size)
return -EINVAL;
if (((limit == 0 || limit > memblock_end) &&
(memblock_end - size < highmem_start &&
memblock_end > highmem_start)) ||
(limit > highmem_start && limit - size < highmem_start)) {
limit = highmem_start;
}
/* Sanitise input arguments */
alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
base = ALIGN(base, alignment);