diff mbox series

[RESEND] c6x: switch to NO_BOOTMEM

Message ID 20181027092028.GC6770@rapoport-lnx (mailing list archive)
State New, archived
Headers show
Series [RESEND] c6x: switch to NO_BOOTMEM | expand

Commit Message

Mike Rapoport Oct. 27, 2018, 9:20 a.m. UTC
Hi,

The patch below that switches c6x to NO_BOOTMEM is already merged into c6x
tree, but as there were no pull request from c6x during v4.19 merge window
it is still not present in Linus' tree.

Probably it would be better to direct it via mm tree to avoid possible
conflicts and breakage because of bootmem removal.

Comments

Mark Salter Oct. 27, 2018, 5:20 p.m. UTC | #1
On Sat, 2018-10-27 at 10:20 +0100, Mike Rapoport wrote:
> Hi,
> 
> The patch below that switches c6x to NO_BOOTMEM is already merged into c6x
> tree, but as there were no pull request from c6x during v4.19 merge window
> it is still not present in Linus' tree.
> 
> Probably it would be better to direct it via mm tree to avoid possible
> conflicts and breakage because of bootmem removal.
> 

I had to refresh the patch due to conflict with

commit be7cd2df1d22d29e5f23ce8744fc465cc07cc2bc
Author: Rob Herring <robh@kernel.org>
Date:   Wed Aug 1 15:00:12 2018 -0600

    c6x: use common built-in dtb support

The updated patch is in the c6x tree:

git://linux-c6x.org/git/projects/linux-c6x-upstreaming.git
commit fe381767b94fc53d3db700ba1d55928a4b5bc6c8
Mark Salter Oct. 28, 2018, 4:30 p.m. UTC | #2
On Sat, 2018-10-27 at 13:20 -0400, Mark Salter wrote:
> On Sat, 2018-10-27 at 10:20 +0100, Mike Rapoport wrote:
> > Hi,
> > 
> > The patch below that switches c6x to NO_BOOTMEM is already merged into c6x
> > tree, but as there were no pull request from c6x during v4.19 merge window
> > it is still not present in Linus' tree.
> > 
> > Probably it would be better to direct it via mm tree to avoid possible
> > conflicts and breakage because of bootmem removal.
> > 
> 
> I had to refresh the patch due to conflict with
> 
> commit be7cd2df1d22d29e5f23ce8744fc465cc07cc2bc
> Author: Rob Herring <robh@kernel.org>
> Date:   Wed Aug 1 15:00:12 2018 -0600
> 
>     c6x: use common built-in dtb support
> 
> The updated patch is in the c6x tree:
> 
> git://linux-c6x.org/git/projects/linux-c6x-upstreaming.git
> commit fe381767b94fc53d3db700ba1d55928a4b5bc6c8

Oops, forgot to add my s-o-b. It's now:

commit 4d8106f0299c7942c5f13a22da6d553d28127ef5
Author: Mike Rapoport <rppt@linux.vnet.ibm.com>
Date:   Mon Jun 25 12:02:34 2018 +0300

    c6x: switch to NO_BOOTMEM
diff mbox series

Patch

diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index bf59855628ac..054c7c963180 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -14,6 +14,7 @@  config C6X
 	select GENERIC_IRQ_SHOW
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_MEMBLOCK
+	select NO_BOOTMEM
 	select SPARSE_IRQ
 	select IRQ_DOMAIN
 	select OF
diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
index 786e36e2f61d..cc74cb9d349b 100644
--- a/arch/c6x/kernel/setup.c
+++ b/arch/c6x/kernel/setup.c
@@ -296,7 +296,6 @@  notrace void __init machine_init(unsigned long dt_ptr)
 
 void __init setup_arch(char **cmdline_p)
 {
-	int bootmap_size;
 	struct memblock_region *reg;
 
 	printk(KERN_INFO "Initializing kernel\n");
@@ -353,16 +352,6 @@  void __init setup_arch(char **cmdline_p)
 	init_mm.end_data   = memory_start;
 	init_mm.brk        = memory_start;
 
-	/*
-	 * Give all the memory to the bootmap allocator,  tell it to put the
-	 * boot mem_map at the start of memory
-	 */
-	bootmap_size = init_bootmem_node(NODE_DATA(0),
-					 memory_start >> PAGE_SHIFT,
-					 PAGE_OFFSET >> PAGE_SHIFT,
-					 memory_end >> PAGE_SHIFT);
-	memblock_reserve(memory_start, bootmap_size);
-
 	unflatten_device_tree();
 
 	c6x_cache_init();
@@ -397,22 +386,9 @@  void __init setup_arch(char **cmdline_p)
 	/* Initialize the coherent memory allocator */
 	coherent_mem_init(dma_start, dma_size);
 
-	/*
-	 * Free all memory as a starting point.
-	 */
-	free_bootmem(PAGE_OFFSET, memory_end - PAGE_OFFSET);
-
-	/*
-	 * Then reserve memory which is already being used.
-	 */
-	for_each_memblock(reserved, reg) {
-		pr_debug("reserved - 0x%08x-0x%08x\n",
-			 (u32) reg->base, (u32) reg->size);
-		reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
-	}
-
 	max_low_pfn = PFN_DOWN(memory_end);
 	min_low_pfn = PFN_UP(memory_start);
+	max_pfn = max_low_pfn;
 	max_mapnr = max_low_pfn - min_low_pfn;
 
 	/* Get kmalloc into gear */