OpenCloudOS-Kernel/arch/openrisc
Oreoluwa Babatunde 7ad21517c3 openrisc: Call setup_memory() earlier in the init sequence
[ Upstream commit 7b432bf376c9c198a7ff48f1ed14a14c0ffbe1fe ]

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 setup_memory()
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 setup_memory() to be earlier in the init
sequence so that the reserved memory regions are set aside before any
allocations are done using memblock.

Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-29 17:33:39 +02:00
..
boot kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
configs treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
include OpenRISC updates for 6.6 2023-09-05 10:09:31 -07:00
kernel openrisc: Call setup_memory() earlier in the init sequence 2024-08-29 17:33:39 +02:00
lib openrisc/delay: Add include to fix symbol not declared warning 2022-05-23 17:15:49 +09:00
mm OpenRISC updates for 6.6 2023-09-05 10:09:31 -07:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig openrisc: mm: convert to GENERIC_IOREMAP 2023-08-18 10:12:34 -07:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00