diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2022-12-23 12:27:47 +0100 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-01-03 18:41:01 -0600 |
commit | 2a12187d5853d9fd5102278cecef7dac7c8ce7ea (patch) | |
tree | 2da31c96a1a9a955b6fb20740c719552e1718480 /arch/mips | |
parent | 1b929c02afd37871d5afb9d498426f83432e71c2 (diff) | |
download | linux-stable-2a12187d5853d9fd5102278cecef7dac7c8ce7ea.tar.gz linux-stable-2a12187d5853d9fd5102278cecef7dac7c8ce7ea.tar.bz2 linux-stable-2a12187d5853d9fd5102278cecef7dac7c8ce7ea.zip |
of/fdt: run soc memory setup when early_init_dt_scan_memory fails
If memory has been found early_init_dt_scan_memory now returns 1. If
it hasn't found any memory it will return 0, allowing other memory
setup mechanisms to carry on.
Previously early_init_dt_scan_memory always returned 0 without
distinguishing between any kind of memory setup being done or not. Any
code path after the early_init_dt_scan memory call in the ramips
plat_mem_setup code wouldn't be executed anymore. Making
early_init_dt_scan_memory the only way to initialize the memory.
Some boards, including my mt7621 based Cudy X6 board, depend on memory
initialization being done via the soc_info.mem_detect function
pointer. Those wouldn't be able to obtain memory and panic the kernel
during early bootup with the message "early_init_dt_alloc_memory_arch:
Failed to allocate 12416 bytes align=0x40".
Fixes: 1f012283e936 ("of/fdt: Rework early_init_dt_scan_memory() to call directly")
Cc: stable@vger.kernel.org
Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
Link: https://lore.kernel.org/r/20221223112748.2935235-1-andreas@rammhold.de
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/ralink/of.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c index 01c132bc33d5..4d06de77d92a 100644 --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c @@ -64,7 +64,7 @@ void __init plat_mem_setup(void) dtb = get_fdt(); __dt_setup_arch(dtb); - if (!early_init_dt_scan_memory()) + if (early_init_dt_scan_memory()) return; if (soc_info.mem_detect) |