linux-stable/arch
Andreas Rammhold 04836fc5b7 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:00:47 +01:00
..
alpha alpha: fix syscall entry in !AUDUT_SYSCALL case 2022-12-31 13:25:42 +01:00
arc arc: iounmap() arg is volatile 2022-11-04 00:00:27 +09:00
arm ARM: renumber bits related to _TIF_WORK_MASK 2023-01-12 12:00:27 +01:00
arm64 arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon 2023-01-07 11:15:53 +01:00
csky Merge 'irq/loongarch', 'pci/ctrl/loongson' and 'pci/header-cleanup-immutable' 2022-08-11 21:06:14 +08:00
hexagon provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
ia64 ia64: export memory_add_physaddr_to_nid to fix cxl build error 2022-10-21 12:38:34 +02:00
loongarch LoongArch: Fix unsigned comparison with less than zero 2022-12-14 11:40:47 +01:00
m68k m68k: Rework BI_VIRT_RNG_SEED as BI_RNG_SEED 2022-11-16 10:03:48 +01:00
microblaze - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
mips of/fdt: run soc memory setup when early_init_dt_scan_memory fails 2023-01-12 12:00:47 +01:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-12-02 17:43:11 +01:00
openrisc Updates to various subsystems which I help look after. lib, ocfs2, 2022-08-07 10:03:24 -07:00
parisc parisc: Drop PMD_SHIFT from calculation in pgtable.h 2023-01-07 11:15:59 +01:00
powerpc powerpc/ftrace: fix syscall tracing on PPC64_ELF_ABI_V1 2023-01-07 11:15:51 +01:00
riscv riscv, kprobes: Stricter c.jr/c.jalr decoding 2023-01-12 12:00:47 +01:00
s390 KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field 2022-12-14 11:40:53 +01:00
sh sh: machvec: Use char[] for section boundaries 2022-10-21 12:37:59 +02:00
sparc sparc: Unbreak the build 2022-10-12 09:39:04 +02:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-21 12:37:40 +02:00
x86 x86/bugs: Flush IBP in ib_prctl_set() 2023-01-12 12:00:45 +01:00
xtensa xtensa: add __umulsidi3 helper 2023-01-07 11:15:50 +01:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:26:31 +01:00