linux-stable/arch/mips
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
..
alchemy MIPS: Alchemy: devboards: Remove duplicate 'the' in two places. 2022-07-05 11:11:36 +02:00
ar7
ath25
ath79 MIPS: ath79: Remove one of the identical args in early_printk 2022-07-08 15:13:26 +02:00
bcm47xx MIPS: BCM47XX: Cast memcmp() of function to (void *) 2022-10-21 12:39:04 +02:00
bcm63xx MIPS: BCM63xx: Add check for NULL for clk in clk_enable 2022-12-31 13:25:47 +01:00
bmips MIPS: BMIPS: Utilize cfe_die() for invalid DTB 2022-07-17 14:53:07 +02:00
boot mips: dts: ralink: mt7621: fix external phy on GB-PC2 2022-10-21 12:38:16 +02:00
cavium-octeon MIPS: OCTEON: warn only once if deprecated link status is being used 2022-12-31 13:25:47 +01:00
cobalt
configs added support for Netgear WNR3500L v2 2022-08-06 16:47:19 -07:00
crypto MIPS: crypto: Fix CRC32 code 2022-04-01 10:19:03 +02:00
dec MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
fw MIPS: CFE: Add cfe_die() 2022-07-17 14:52:47 +02:00
generic arch: mips: generic: Add missing of_node_put() in board-ranchu.c 2022-06-21 17:04:30 +02:00
include mips: ralink: mt7621: define MT7621_SYSC_BASE with __iomem 2022-12-31 13:25:45 +01:00
ingenic
jazz MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
kernel MIPS: vpe-cmp: fix possible memory leak while module exiting 2022-12-31 13:25:43 +01:00
kvm KVM: Rename mmu_notifier_* to mmu_invalidate_* 2022-08-19 04:05:41 -04:00
lantiq MIPS: lantiq: export clk_get_io() for lantiq_wdt.ko 2022-09-19 16:30:48 +02:00
lib MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
loongson2ef
loongson32 MIPS: Loongson32: Fix PHY-mode being left unspecified 2022-09-19 16:31:32 +02:00
loongson64 MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed 2022-11-26 09:27:33 +01:00
math-emu MIPS: math-emu: Use the bitmap API to allocate bitmaps 2022-07-11 10:27:50 +02:00
mm added support for Netgear WNR3500L v2 2022-08-06 16:47:19 -07:00
mti-malta mips: mti-malta: Fix refcount leak in malta-time.c 2022-06-21 17:04:30 +02:00
n64
net MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
pci MIPS: msi-octeon: eliminate kernel-doc warnings 2022-07-30 10:58:26 +02:00
pic32 MIPS: pic32: treat port as signed integer 2022-12-02 17:43:02 +01:00
power
ralink of/fdt: run soc memory setup when early_init_dt_scan_memory fails 2023-01-12 12:00:47 +01:00
rb532 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
sgi-ip22 mips: sgi-ip22: Drop redundant check from .remove() 2022-07-05 11:10:17 +02:00
sgi-ip27 MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create() 2022-10-21 12:37:59 +02:00
sgi-ip30 MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create() 2022-10-21 12:37:59 +02:00
sgi-ip32
sibyte Cleanups and fixes 2022-05-30 11:01:50 -07:00
sni
tools MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
txx9 MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
vdso
Kbuild
Kbuild.platforms MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
Kconfig mips: Select SPARSEMEM_EXTREME 2022-09-09 17:37:27 +02:00
Kconfig.debug
Makefile MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
Makefile.postlink