aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-31 09:20:16 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-31 09:20:16 -0400
commit7b70c4275f28702b76b273c8534c38f8313812e9 (patch)
tree1df2229ca02466bd1adda814ac5c37aa0a597db1 /arch/arm/mm/init.c
parentceb0885d3b01bb2e2f18765770e212914f2864be (diff)
parenta20df564d15bd28e3df24e1c65b885bd74d23f17 (diff)
Merge branch 'devel-stable' into devel
Conflicts: arch/arm/kernel/entry-armv.S arch/arm/kernel/setup.c arch/arm/mm/init.c
Diffstat (limited to 'arch/arm/mm/init.c')
-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 240b68d511dc..7185b00650fe 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -398,28 +398,27 @@ static void __init free_unused_memmap(struct meminfo *mi)
398 unsigned int i; 398 unsigned int i;
399 399
400 /* 400 /*
401 * [FIXME] This relies on each bank being in address order. This 401 * This relies on each bank being in address order.
402 * may not be the case, especially if the user has provided the 402 * The banks are sorted previously in bootmem_init().
403 * information on the command line.
404 */ 403 */
405 for_each_bank(i, mi) { 404 for_each_bank(i, mi) {
406 struct membank *bank = &mi->bank[i]; 405 struct membank *bank = &mi->bank[i];
407 406
408 bank_start = bank_pfn_start(bank); 407 bank_start = bank_pfn_start(bank);
409 if (bank_start < prev_bank_end) {
410 printk(KERN_ERR "MEM: unordered memory banks. "
411 "Not freeing memmap.\n");
412 break;
413 }
414 408
415 /* 409 /*
416 * If we had a previous bank, and there is a space 410 * If we had a previous bank, and there is a space
417 * between the current bank and the previous, free it. 411 * between the current bank and the previous, free it.
418 */ 412 */
419 if (prev_bank_end && prev_bank_end != bank_start) 413 if (prev_bank_end && prev_bank_end < bank_start)
420 free_memmap(prev_bank_end, bank_start); 414 free_memmap(prev_bank_end, bank_start);
421 415
422 prev_bank_end = bank_pfn_end(bank); 416 /*
417 * Align up here since the VM subsystem insists that the
418 * memmap entries are valid from the bank end aligned to
419 * MAX_ORDER_NR_PAGES.
420 */
421 prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
423 } 422 }
424} 423}
425 424