linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Changbin Du <changbin.du@gmail.com>
To: Anup Patel <anup@brainfault.org>
Cc: Changbin Du <changbin.du@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] riscv: Do not invoke early_init_dt_verify() twice
Date: Thu, 25 Mar 2021 15:55:51 +0000	[thread overview]
Message-ID: <20210325155550.udz33f3kivbi7j76@mail.google.com> (raw)
In-Reply-To: <CAAhSdy19Tpf1D0Q4V7CF0ZOvksHMXxA2fF3L3J2f_Ka8NZgVAQ@mail.gmail.com>

On Wed, Mar 24, 2021 at 08:51:06PM +0530, Anup Patel wrote:
> On Wed, Mar 24, 2021 at 8:33 PM Changbin Du <changbin.du@gmail.com> wrote:
> >
> > In the setup_arch() of riscv, function early_init_dt_verify() has
> > been done by parse_dtb(). So no need to call it again. Just directly
> > invoke unflatten_device_tree().
> >
> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> > ---
> >  arch/riscv/kernel/setup.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> > index f8f15332caa2..2a3d487e1710 100644
> > --- a/arch/riscv/kernel/setup.c
> > +++ b/arch/riscv/kernel/setup.c
> > @@ -255,10 +255,7 @@ void __init setup_arch(char **cmdline_p)
> >  #if IS_ENABLED(CONFIG_BUILTIN_DTB)
> >         unflatten_and_copy_device_tree();
> >  #else
> > -       if (early_init_dt_verify(__va(dtb_early_pa)))
> > -               unflatten_device_tree();
> > -       else
> > -               pr_err("No DTB found in kernel mappings\n");
> > +       unflatten_device_tree();
> >  #endif
> 
> The early_init_dt_verify() set he DTB base address in Linux OF.
> 
> When parse_dtb() calls early_init_dt_verify(), MMU is enabled but
> we have temporary mapping for DTB (i.e. dtb_early_va).
> 
> After paging_init(), we have moved to final swapper_pg_dir so
> temporary mapping for DTB does not exists anymore but DTB
> is at same physical address so update DTB base address in
> Linux OF by calling early_init_dt_verify() again.
> 
> Based on above, NACK to this patch.
>
No problem, thanks!
 
> Regards,
> Anup
> 
> >         misc_mem_init();
> >
> > --
> > 2.30.2
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv

-- 
Cheers,
Changbin Du

      reply	other threads:[~2021-03-25 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 15:03 [PATCH] riscv: Do not invoke early_init_dt_verify() twice Changbin Du
2021-03-24 15:21 ` Anup Patel
2021-03-25 15:55   ` Changbin Du [this message]

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=20210325155550.udz33f3kivbi7j76@mail.google.com \
    --to=changbin.du@gmail.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /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 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).