All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/prom: move the device tree to the right space
@ 2021-03-03  5:00 ` Youlin Song
  0 siblings, 0 replies; 3+ messages in thread
From: Youlin Song @ 2021-03-03  5:00 UTC (permalink / raw)
  To: mpe, benh, paulus, christophe.leroy
  Cc: linuxppc-dev, linux-kernel, Youlin Song

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.

Signed-off-by: Youlin Song <syl.loop@gmail.com>
---
 arch/powerpc/kernel/prom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9a4797d1d40d..ef5f93e7d7f2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] powerpc/prom: move the device tree to the right space
@ 2021-03-03  5:00 ` Youlin Song
  0 siblings, 0 replies; 3+ messages in thread
From: Youlin Song @ 2021-03-03  5:00 UTC (permalink / raw)
  To: mpe, benh, paulus, christophe.leroy
  Cc: Youlin Song, linuxppc-dev, linux-kernel

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.

Signed-off-by: Youlin Song <syl.loop@gmail.com>
---
 arch/powerpc/kernel/prom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9a4797d1d40d..ef5f93e7d7f2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/prom: move the device tree to the right space
  2021-03-03  5:00 ` Youlin Song
  (?)
@ 2022-09-07 17:11 ` Christophe Leroy
  -1 siblings, 0 replies; 3+ messages in thread
From: Christophe Leroy @ 2022-09-07 17:11 UTC (permalink / raw)
  To: Youlin Song, mpe, benh, paulus; +Cc: linuxppc-dev, linux-kernel



Le 03/03/2021 à 06:00, Youlin Song a écrit :
> 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

> 
> Signed-off-by: Youlin Song <syl.loop@gmail.com>
> ---
>   arch/powerpc/kernel/prom.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 9a4797d1d40d..ef5f93e7d7f2 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-07 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  5:00 [PATCH] powerpc/prom: move the device tree to the right space Youlin Song
2021-03-03  5:00 ` Youlin Song
2022-09-07 17:11 ` Christophe Leroy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.