Skip to contentSkip to conversation

powerpc/prom: move the device tree to the right space

PATCH In review Youlin Song 2 participants 2 messages Mar 3, 2021 – Sep 7, 2022 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/prom: move the device tree to the right space

If the device tree has been allocated memory and it will be in the memblock reserved space.Obviously it is in a valid memory declaration and will be mapped by the kernel.

---
 arch/powerpc/kernel/prom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/prom.c +1 -1
index 9a4797d1d40d..ef5f93e7d7f2 100644
@@ -121,7 +121,7 @@ static void __init move_device_tree(void)
 	size = fdt_totalsize(initial_boot_params);
 
 	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
-	    !memblock_is_memory(start + size - 1) ||
+	    (!memblock_is_memory(start + size - 1) && !memblock_is_reserved(start + size - 1)) ||
 	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
 		p = memblock_alloc_raw(size, PAGE_SIZE);
 		if (!p)
Signature · 1 line
2.25.1
#1 lore raw

Le 03/03/2021 à 06:00, Youlin Song a écrit :

Quoted 3 lines

If the device tree has been allocated memory and it will be in the memblock reserved space.Obviously it is in a valid memory declaration and will be mapped by the kernel.

Could you please provide clearer explanation ? I don't understand what you are doing and why.

Especially, the Subject says you move the device tree, but I can't see any move in your patch, only some change in the 'if'.

Thanks
Christophe

Quoted 19 lines
---
  arch/powerpc/kernel/prom.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/prom.c +1 -1
index 9a4797d1d40d..ef5f93e7d7f2 100644
@@ -121,7 +121,7 @@ static void __init move_device_tree(void)
  	size = fdt_totalsize(initial_boot_params);
 
  	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
-	    !memblock_is_memory(start + size - 1) ||
+	    (!memblock_is_memory(start + size - 1) && !memblock_is_reserved(start + size - 1)) ||
  	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
  		p = memblock_alloc_raw(size, PAGE_SIZE);
  		if (!p)