aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/init.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f6a999465323..e18c7cedb482 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -495,28 +495,27 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
495 unsigned int i; 495 unsigned int i;
496 496
497 /* 497 /*
498 * [FIXME] This relies on each bank being in address order. This 498 * This relies on each bank being in address order.
499 * may not be the case, especially if the user has provided the 499 * The banks are sorted previously in bootmem_init().
500 * information on the command line.
501 */ 500 */
502 for_each_nodebank(i, mi, node) { 501 for_each_nodebank(i, mi, node) {
503 struct membank *bank = &mi->bank[i]; 502 struct membank *bank = &mi->bank[i];
504 503
505 bank_start = bank_pfn_start(bank); 504 bank_start = bank_pfn_start(bank);
506 if (bank_start < prev_bank_end) {
507 printk(KERN_ERR "MEM: unordered memory banks. "
508 "Not freeing memmap.\n");
509 break;
510 }
511 505
512 /* 506 /*
513 * If we had a previous bank, and there is a space 507 * If we had a previous bank, and there is a space
514 * between the current bank and the previous, free it. 508 * between the current bank and the previous, free it.
515 */ 509 */
516 if (prev_bank_end && prev_bank_end != bank_start) 510 if (prev_bank_end && prev_bank_end < bank_start)
517 free_memmap(node, prev_bank_end, bank_start); 511 free_memmap(node, prev_bank_end, bank_start);
518 512
519 prev_bank_end = bank_pfn_end(bank); 513 /*
514 * Align up here since the VM subsystem insists that the
515 * memmap entries are valid from the bank end aligned to
516 * MAX_ORDER_NR_PAGES.
517 */
518 prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
520 } 519 }
521} 520}
522 521