linux/arch/mips
Andreas Rammhold c4849f1818 of/fdt: run soc memory setup when early_init_dt_scan_memory fails
commit 2a12187d58 upstream.

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: 1f012283e9 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-12 12:02:51 +01:00
..
alchemy
ar7
ath25
ath79
bcm47xx
bcm63xx MIPS: BCM63xx: Add check for NULL for clk in clk_enable 2022-12-31 13:32:00 +01:00
bmips
boot MIPS: DTS: CI20: fix reset line polarity of the ethernet controller 2022-12-31 13:31:47 +01:00
cavium-octeon MIPS: OCTEON: warn only once if deprecated link status is being used 2022-12-31 13:32:00 +01:00
cobalt
configs
crypto
dec
fw
generic
include mips: ralink: mt7621: define MT7621_SYSC_BASE with __iomem 2022-12-21 17:48:03 +01:00
ingenic
jazz
kernel MIPS: vpe-cmp: fix possible memory leak while module exiting 2022-12-31 13:31:56 +01:00
kvm
lantiq
lib
loongson2ef
loongson32
loongson64
math-emu
mm
mti-malta
n64
net
pci
pic32
power
ralink of/fdt: run soc memory setup when early_init_dt_scan_memory fails 2023-01-12 12:02:51 +01:00
rb532
sgi-ip22
sgi-ip27
sgi-ip30
sgi-ip32
sibyte
sni
tools
txx9
vdso
Kbuild
Kbuild.platforms
Kconfig
Kconfig.debug
Makefile
Makefile.postlink