Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[linux-2.6-block.git] / drivers / firmware / efi / arm-init.c
index ef90f0c4b70a735def7eb9c56aec980f7813a8fe..a850cbc48d8d17a3de7ba51cb7ea033e57ed4fcd 100644 (file)
@@ -178,6 +178,14 @@ static __init void reserve_regions(void)
        if (efi_enabled(EFI_DBG))
                pr_info("Processing EFI memory map:\n");
 
+       /*
+        * Discard memblocks discovered so far: if there are any at this
+        * point, they originate from memory nodes in the DT, and UEFI
+        * uses its own memory map instead.
+        */
+       memblock_dump_all();
+       memblock_remove(0, (phys_addr_t)ULLONG_MAX);
+
        for_each_efi_memory_desc(md) {
                paddr = md->phys_addr;
                npages = md->num_pages;