]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/arm/mm/init.c
Merge branch 'devel-stable' into devel
[mv-sheeva.git] / arch / arm / mm / init.c
index 240b68d511dc1437c6fcb8bbfb491582fea72280..7185b00650fe419d0fa0f43b3e79e2e0d90cf6e6 100644 (file)
@@ -398,28 +398,27 @@ static void __init free_unused_memmap(struct meminfo *mi)
        unsigned int i;
 
        /*
-        * [FIXME] This relies on each bank being in address order.  This
-        * may not be the case, especially if the user has provided the
-        * information on the command line.
+        * This relies on each bank being in address order.
+        * The banks are sorted previously in bootmem_init().
         */
        for_each_bank(i, mi) {
                struct membank *bank = &mi->bank[i];
 
                bank_start = bank_pfn_start(bank);
-               if (bank_start < prev_bank_end) {
-                       printk(KERN_ERR "MEM: unordered memory banks.  "
-                               "Not freeing memmap.\n");
-                       break;
-               }
 
                /*
                 * If we had a previous bank, and there is a space
                 * between the current bank and the previous, free it.
                 */
-               if (prev_bank_end && prev_bank_end != bank_start)
+               if (prev_bank_end && prev_bank_end < bank_start)
                        free_memmap(prev_bank_end, bank_start);
 
-               prev_bank_end = bank_pfn_end(bank);
+               /*
+                * Align up here since the VM subsystem insists that the
+                * memmap entries are valid from the bank end aligned to
+                * MAX_ORDER_NR_PAGES.
+                */
+               prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
        }
 }