linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: use memblocks_present
@ 2019-02-10  9:28 Peng Fan
  2019-02-10  9:55 ` Mike Rapoport
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Peng Fan @ 2019-02-10  9:28 UTC (permalink / raw)
  To: catalin.marinas, will.deacon
  Cc: Peng Fan, f.fainelli, ard.biesheuvel, logang, linux-kernel,
	stefan, rppt, james.morse, hannes, van.freenix, akpm,
	robin.murphy, linux-arm-kernel, ghackmann

arm64_memory_present is doing same thing as memblocks_present, so
let's use common code memblocks_present instead of platform
specific arm64_memory_present.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm64/mm/init.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 7205a9085b4d..2302b4093a63 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -285,24 +285,6 @@ int pfn_valid(unsigned long pfn)
 }
 EXPORT_SYMBOL(pfn_valid);
 
-#ifndef CONFIG_SPARSEMEM
-static void __init arm64_memory_present(void)
-{
-}
-#else
-static void __init arm64_memory_present(void)
-{
-	struct memblock_region *reg;
-
-	for_each_memblock(memory, reg) {
-		int nid = memblock_get_region_node(reg);
-
-		memory_present(nid, memblock_region_memory_base_pfn(reg),
-				memblock_region_memory_end_pfn(reg));
-	}
-}
-#endif
-
 static phys_addr_t memory_limit = PHYS_ADDR_MAX;
 
 /*
@@ -489,7 +471,7 @@ void __init bootmem_init(void)
 	 * Sparsemem tries to allocate bootmem in memory_present(), so must be
 	 * done after the fixed reservations.
 	 */
-	arm64_memory_present();
+	memblocks_present();
 
 	sparse_init();
 	zone_sizes_init(min, max);
-- 
2.14.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: use memblocks_present
  2019-02-10  9:28 [PATCH] arm64: use memblocks_present Peng Fan
@ 2019-02-10  9:55 ` Mike Rapoport
  2019-02-11 11:06 ` Will Deacon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Mike Rapoport @ 2019-02-10  9:55 UTC (permalink / raw)
  To: Peng Fan
  Cc: f.fainelli, ard.biesheuvel, catalin.marinas, will.deacon,
	linux-kernel, stefan, logang, rppt, james.morse, hannes,
	van.freenix, akpm, robin.murphy, linux-arm-kernel, ghackmann

On Sun, Feb 10, 2019 at 09:28:43AM +0000, Peng Fan wrote:
> arm64_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm64_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Acked-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  arch/arm64/mm/init.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 7205a9085b4d..2302b4093a63 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -285,24 +285,6 @@ int pfn_valid(unsigned long pfn)
>  }
>  EXPORT_SYMBOL(pfn_valid);
>  
> -#ifndef CONFIG_SPARSEMEM
> -static void __init arm64_memory_present(void)
> -{
> -}
> -#else
> -static void __init arm64_memory_present(void)
> -{
> -	struct memblock_region *reg;
> -
> -	for_each_memblock(memory, reg) {
> -		int nid = memblock_get_region_node(reg);
> -
> -		memory_present(nid, memblock_region_memory_base_pfn(reg),
> -				memblock_region_memory_end_pfn(reg));
> -	}
> -}
> -#endif
> -
>  static phys_addr_t memory_limit = PHYS_ADDR_MAX;
>  
>  /*
> @@ -489,7 +471,7 @@ void __init bootmem_init(void)
>  	 * Sparsemem tries to allocate bootmem in memory_present(), so must be
>  	 * done after the fixed reservations.
>  	 */
> -	arm64_memory_present();
> +	memblocks_present();
>  
>  	sparse_init();
>  	zone_sizes_init(min, max);
> -- 
> 2.14.1
> 

-- 
Sincerely yours,
Mike.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: use memblocks_present
  2019-02-10  9:28 [PATCH] arm64: use memblocks_present Peng Fan
  2019-02-10  9:55 ` Mike Rapoport
@ 2019-02-11 11:06 ` Will Deacon
  2019-02-11 12:20 ` Catalin Marinas
  2019-02-11 17:26 ` Logan Gunthorpe
  3 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2019-02-11 11:06 UTC (permalink / raw)
  To: Peng Fan
  Cc: f.fainelli, ard.biesheuvel, catalin.marinas, linux-kernel,
	stefan, logang, rppt, james.morse, hannes, van.freenix, akpm,
	robin.murphy, linux-arm-kernel, ghackmann

On Sun, Feb 10, 2019 at 09:28:43AM +0000, Peng Fan wrote:
> arm64_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm64_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm64/mm/init.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

Catalin -- can you pick this one up, please?

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: use memblocks_present
  2019-02-10  9:28 [PATCH] arm64: use memblocks_present Peng Fan
  2019-02-10  9:55 ` Mike Rapoport
  2019-02-11 11:06 ` Will Deacon
@ 2019-02-11 12:20 ` Catalin Marinas
  2019-02-11 12:26   ` Peng Fan
  2019-02-11 17:26 ` Logan Gunthorpe
  3 siblings, 1 reply; 6+ messages in thread
From: Catalin Marinas @ 2019-02-11 12:20 UTC (permalink / raw)
  To: Peng Fan
  Cc: f.fainelli, ard.biesheuvel, logang, will.deacon, linux-kernel,
	stefan, rppt, james.morse, hannes, van.freenix, akpm,
	robin.murphy, linux-arm-kernel, ghackmann

On Sun, Feb 10, 2019 at 09:28:43AM +0000, Peng Fan wrote:
> arm64_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm64_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

I already merged a similar one (see commit
a2c801c53d1682871fba1e037c9d3b0c9fffee8a in -next).

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] arm64: use memblocks_present
  2019-02-11 12:20 ` Catalin Marinas
@ 2019-02-11 12:26   ` Peng Fan
  0 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2019-02-11 12:26 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: f.fainelli, ard.biesheuvel, logang, will.deacon, linux-kernel,
	stefan, rppt, james.morse, hannes, van.freenix, akpm,
	robin.murphy, linux-arm-kernel, ghackmann



> -----Original Message-----
> From: Catalin Marinas [mailto:catalin.marinas@arm.com]
> Sent: 2019年2月11日 20:21
> To: Peng Fan <peng.fan@nxp.com>
> Cc: will.deacon@arm.com; akpm@linux-foundation.org;
> rppt@linux.vnet.ibm.com; ard.biesheuvel@linaro.org; f.fainelli@gmail.com;
> robin.murphy@arm.com; james.morse@arm.com; ghackmann@android.com;
> stefan@agner.ch; hannes@cmpxchg.org; logang@deltatee.com;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> van.freenix@gmail.com
> Subject: Re: [PATCH] arm64: use memblocks_present
> 
> On Sun, Feb 10, 2019 at 09:28:43AM +0000, Peng Fan wrote:
> > arm64_memory_present is doing same thing as memblocks_present, so
> > let's use common code memblocks_present instead of platform specific
> > arm64_memory_present.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 
> I already merged a similar one (see commit
> a2c801c53d1682871fba1e037c9d3b0c9fffee8a in -next).

I should check your tree first before sending patches.

The arm32 code could also use similar logic, need check arm tree :)

Thanks,
Peng.

> 
> --
> Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: use memblocks_present
  2019-02-10  9:28 [PATCH] arm64: use memblocks_present Peng Fan
                   ` (2 preceding siblings ...)
  2019-02-11 12:20 ` Catalin Marinas
@ 2019-02-11 17:26 ` Logan Gunthorpe
  3 siblings, 0 replies; 6+ messages in thread
From: Logan Gunthorpe @ 2019-02-11 17:26 UTC (permalink / raw)
  To: Peng Fan, catalin.marinas, will.deacon
  Cc: f.fainelli, ard.biesheuvel, linux-kernel, stefan, rppt,
	james.morse, hannes, van.freenix, akpm, robin.murphy,
	linux-arm-kernel, ghackmann



On 2019-02-10 2:28 a.m., Peng Fan wrote:
> arm64_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm64_memory_present.

I've already sent patches for this[1]. The arm64 one was already queued
up by Catalin.

Thanks,

Logan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-02-11 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-10  9:28 [PATCH] arm64: use memblocks_present Peng Fan
2019-02-10  9:55 ` Mike Rapoport
2019-02-11 11:06 ` Will Deacon
2019-02-11 12:20 ` Catalin Marinas
2019-02-11 12:26   ` Peng Fan
2019-02-11 17:26 ` Logan Gunthorpe

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).