Commit 9fa304b9 authored by Huacai Chen's avatar Huacai Chen
Browse files

LoongArch: Call early_init_fdt_scan_reserved_mem() earlier

The unflatten_and_copy_device_tree() function contains a call to
memblock_alloc(). This means that memblock is allocating memory before
any of the reserved memory regions are set aside in the arch_mem_init()
function which calls early_init_fdt_scan_reserved_mem(). Therefore,
there is a possibility for memblock to allocate from any of the
reserved memory regions.

Hence, move the call to early_init_fdt_scan_reserved_mem() to be earlier
in the init sequence, so that the reserved memory regions are set aside
before any allocations are done using memblock.

Cc: stable@vger.kernel.org
Fixes: 88d4d957

 ("LoongArch: Add FDT booting support from efi system table")
Signed-off-by: default avatarOreoluwa Babatunde <quic_obabatun@quicinc.com>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 752cd08d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment