All of lore.kernel.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: akpm@linux-foundation.org, Paul Walmsley <paul@pwsan.com>,
	Atish Patra <Atish.Patra@wdc.com>,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	rppt@linux.ibm.com, Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: linux-next: manual merge of the akpm-current tree with the risc-v tree
Date: Tue, 06 Oct 2020 21:32:01 -0700 (PDT)	[thread overview]
Message-ID: <mhng-2d15c259-f5ff-4bab-92eb-b5f0eb2f4bd6@palmerdabbelt-glaptop1> (raw)
In-Reply-To: <20201006213906.08554ae2@canb.auug.org.au>

On Tue, 06 Oct 2020 03:39:06 PDT (-0700), Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the akpm-current tree got a conflict in:
>
>   arch/riscv/mm/init.c
>
> between commit:
>
>   c29c38fa2a8b ("RISC-V: Remove any memblock representing unusable memory area")
>
> from the risc-v tree and commits:
>
>   3520eeb79142 ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
>
> from the akpm-current tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> It also looks like there is a bug in that risc-v tree patch: mem_start
> is used uninitialised in setup_bootmem().
> -- 
> Cheers,
> Stephen Rothwell
>
> diff --cc arch/riscv/mm/init.c
> index 812a48c91a95,bc72bb6b5fe0..000000000000
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@@ -152,20 -141,25 +152,20 @@@ disable
>   }
>   #endif /* CONFIG_BLK_DEV_INITRD */
>   
>  -static phys_addr_t dtb_early_pa __initdata;
>  -
>   void __init setup_bootmem(void)
>   {
> - 	struct memblock_region *reg;
> - 	phys_addr_t mem_start, end = 0;
>  -	phys_addr_t mem_size = 0;
>  -	phys_addr_t total_mem = 0;
> + 	phys_addr_t mem_start, start, end = 0;
>   	phys_addr_t vmlinux_end = __pa_symbol(&_end);
>   	phys_addr_t vmlinux_start = __pa_symbol(&_start);
> + 	u64 i;
>   
>   	/* Find the memory region containing the kernel */
> - 	for_each_memblock(memory, reg) {
> - 		end = reg->base + reg->size;
> + 	for_each_mem_range(i, &start, &end) {
> + 		phys_addr_t size = end - start;
>  -		if (!total_mem)
>  +		if (!mem_start)
> - 			mem_start = reg->base;
> - 		if (reg->base <= vmlinux_start && vmlinux_end <= end)
> - 			BUG_ON(reg->size == 0);
> + 			mem_start = start;
> + 		if (start <= vmlinux_start && vmlinux_end <= end)
> + 			BUG_ON(size == 0);
>  -		total_mem = total_mem + size;
>   	}
>   
>   	/*
> @@@ -542,18 -455,11 +533,18 @@@ static void __init setup_vm_final(void
>   {
>   	uintptr_t va, map_size;
>   	phys_addr_t pa, start, end;
> - 	struct memblock_region *reg;
> + 	u64 i;
>   
>  -	/* Set mmu_enabled flag */
>  -	mmu_enabled = true;
>  -
>  +	/**
>  +	 * MMU is enabled at this point. But page table setup is not complete yet.
>  +	 * fixmap page table alloc functions should be used at this point
>  +	 */
>  +	pt_ops.alloc_pte = alloc_pte_fixmap;
>  +	pt_ops.get_pte_virt = get_pte_virt_fixmap;
>  +#ifndef __PAGETABLE_PMD_FOLDED
>  +	pt_ops.alloc_pmd = alloc_pmd_fixmap;
>  +	pt_ops.get_pmd_virt = get_pmd_virt_fixmap;
>  +#endif
>   	/* Setup swapper PGD for fixmap */
>   	create_pgd_mapping(swapper_pg_dir, FIXADDR_START,
>   			   __pa_symbol(fixmap_pgd_next),

Thanks for pointing this out.  Given that this is the tip of my for-next I'm
just going to drop it, we'll sort out the bug and the conflict.

  reply	other threads:[~2020-10-07  4:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 10:39 linux-next: manual merge of the akpm-current tree with the risc-v tree Stephen Rothwell
2020-10-07  4:32 ` Palmer Dabbelt [this message]
2020-10-07  4:48   ` Atish Patra
2020-10-07 21:58     ` Atish Patra
  -- strict thread matches above, loose matches on Subject: below --
2021-06-01  6:27 Stephen Rothwell
2021-03-12  6:37 Stephen Rothwell
2021-05-06  1:33 ` Stephen Rothwell
2020-12-14  9:21 Stephen Rothwell
2020-12-14 17:37 ` Andy Shevchenko
2020-12-15  0:55   ` Palmer Dabbelt
2020-12-17  1:25 ` Stephen Rothwell
2020-12-17  9:40   ` Andy Shevchenko
2020-12-17 10:05     ` Stephen Rothwell
2020-12-17 17:06     ` Palmer Dabbelt
2020-11-27  7:34 Stephen Rothwell
2020-12-17  1:26 ` Stephen Rothwell
2020-12-17  2:18   ` Kefeng Wang
2020-07-10  7:44 Stephen Rothwell
2020-04-28  6:55 Stephen Rothwell
2019-09-02 11:48 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mhng-2d15c259-f5ff-4bab-92eb-b5f0eb2f4bd6@palmerdabbelt-glaptop1 \
    --to=palmer@dabbelt.com \
    --cc=Atish.Patra@wdc.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=rppt@linux.ibm.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.