devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: fix skipping call to early_init_fdt_scan_reserved_mem
@ 2014-04-30  6:03 Rob Herring
  2014-05-12  0:42 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2014-04-30  6:03 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Grant Likely, Rob Herring, Marek Szyprowski,
	Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ

From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

The call to early_init_fdt_scan_reserved_mem will be skipped if
reserved-ranges is not found. Move the call earlier so that it is called
unconditionally.

Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Cc: Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Tested-by: Stephen Chivers <schivers-SmukeSwxQOQ@public.gmane.org>
---
I found this issue in testing of my fdt clean-up series (thanks to 
Stephen). Since the reserved memory support is new, I don't think it is 
critical to fix this for 3.15. I plan to include this with my fdt series 
for 3.16 unless I hear otherwise.

Rob

 arch/powerpc/kernel/prom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 668aa47..d657549 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -567,6 +567,8 @@ static void __init early_reserve_mem_dt(void)
 	unsigned long i, len, dt_root;
 	const __be32 *prop;
 
+	early_init_fdt_scan_reserved_mem();
+
 	dt_root = of_get_flat_dt_root();
 
 	prop = of_get_flat_dt_prop(dt_root, "reserved-ranges", &len);
@@ -589,8 +591,6 @@ static void __init early_reserve_mem_dt(void)
 			memblock_reserve(base, size);
 		}
 	}
-
-	early_init_fdt_scan_reserved_mem();
 }
 
 static void __init early_reserve_mem(void)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] powerpc: fix skipping call to early_init_fdt_scan_reserved_mem
  2014-04-30  6:03 [PATCH] powerpc: fix skipping call to early_init_fdt_scan_reserved_mem Rob Herring
@ 2014-05-12  0:42 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2014-05-12  0:42 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel, devicetree, Grant Likely, Rob Herring,
	Marek Szyprowski, Paul Mackerras, linuxppc-dev

On Wed, 2014-04-30 at 01:03 -0500, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> The call to early_init_fdt_scan_reserved_mem will be skipped if
> reserved-ranges is not found. Move the call earlier so that it is called
> unconditionally.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Tested-by: Stephen Chivers <schivers@csc.com>
> ---
> I found this issue in testing of my fdt clean-up series (thanks to 
> Stephen). Since the reserved memory support is new, I don't think it is 
> critical to fix this for 3.15. I plan to include this with my fdt series 
> for 3.16 unless I hear otherwise.

Sure, go for it.

Cheers,
Ben.

> Rob
> 
>  arch/powerpc/kernel/prom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 668aa47..d657549 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -567,6 +567,8 @@ static void __init early_reserve_mem_dt(void)
>  	unsigned long i, len, dt_root;
>  	const __be32 *prop;
>  
> +	early_init_fdt_scan_reserved_mem();
> +
>  	dt_root = of_get_flat_dt_root();
>  
>  	prop = of_get_flat_dt_prop(dt_root, "reserved-ranges", &len);
> @@ -589,8 +591,6 @@ static void __init early_reserve_mem_dt(void)
>  			memblock_reserve(base, size);
>  		}
>  	}
> -
> -	early_init_fdt_scan_reserved_mem();
>  }
>  
>  static void __init early_reserve_mem(void)

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

end of thread, other threads:[~2014-05-12  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-30  6:03 [PATCH] powerpc: fix skipping call to early_init_fdt_scan_reserved_mem Rob Herring
2014-05-12  0:42 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).