linux-stable/drivers/of
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
..
unittest-data of: overlay: unittest: add tests for overlay notifiers 2022-05-03 11:53:15 -05:00
Kconfig of: net: move of_net under net/ 2021-10-07 13:39:51 +01:00
Makefile of: net: move of_net under net/ 2021-10-07 13:39:51 +01:00
address.c of: also handle dma-noncoherent in of_dma_is_coherent() 2022-07-28 15:30:20 -07:00
base.c Devicetree updates for v6.0: 2022-08-04 18:08:34 -07:00
device.c of: device: Fix missing of_node_put() in of_dma_set_restricted_buffer 2022-07-12 10:58:33 -06:00
dynamic.c of: Add missing 'Return' section in kerneldoc comments 2021-03-27 12:59:03 -06:00
fdt.c of/fdt: run soc memory setup when early_init_dt_scan_memory fails 2023-01-12 12:00:47 +01:00
fdt_address.c
irq.c of/irq: fix typo in comment 2022-05-23 16:37:01 -05:00
kexec.c of/kexec: Fix reading 32-bit "linux,initrd-{start,end}" values 2023-01-07 11:15:50 +01:00
kobj.c of: kobj: make of_node_is_(initialized|attached) parameters const 2021-10-20 13:37:25 -05:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of: kobj: make of_node_is_(initialized|attached) parameters const 2021-10-20 13:37:25 -05:00
of_reserved_mem.c of: reserved-memory: Print allocation/reservation failures as error 2022-06-28 14:15:36 -06:00
overlay.c of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop() 2022-12-31 13:26:12 +01:00
pdt.c
platform.c drm for 5.19-rc1 2022-05-25 16:18:27 -07:00
property.c of: property: decrement node refcount in of_fwnode_get_reference_args() 2022-12-08 11:30:15 +01:00
resolver.c
unittest.c of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() 2022-07-11 17:08:23 -06:00