From: Quentin Perret <qperret@google.com> To: Rob Herring <robh+dt@kernel.org> Cc: Dong Aisheng <aisheng.dong@nxp.com>, Stephen Boyd <sboyd@kernel.org>, Nicolas Boichat <drinkcat@chromium.org>, KarimAllah Ahmed <karahmed@amazon.de>, linux-mm <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Dong Aisheng <dongas86@gmail.com>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Date: Tue, 22 Jun 2021 09:22:28 +0000 [thread overview] Message-ID: <YNGr1AlWV0AYnL1d@google.com> (raw) In-Reply-To: <CAL_JsqJMyY4iEcJi1z0o7pZdCASYHjnVjf6+fQDqa_ucb-M-MA@mail.gmail.com> On Friday 11 Jun 2021 at 11:10:36 (-0600), Rob Herring wrote: > On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng <aisheng.dong@nxp.com> wrote: > > > > Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"), > > nomap memory is changed to call memblock_mark_nomap() instead of > > memblock_remove(). But it only changed the reserved memory with fixed > > addr and size case in early_init_dt_reserve_memory_arch(), not > > including the dynamical allocation by size case in > > early_init_dt_alloc_reserved_memory_arch(). > > > > Cc: Rob Herring <robh+dt@kernel.org> > > Cc: devicetree@vger.kernel.org > > Good practice is to Cc the people involved in referenced commits. > Adding them now. This code is a minefield so I'd like other eyes on > it. Apologies for the delayed reply -- was away last week. I've been starring at this for 15 minutes, and still can't see how it could go wrong, so FWIW: Reviewed-by: Quentin Perret <qperret@google.com> Thanks, Quentin > > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> > > --- > > drivers/of/of_reserved_mem.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c > > index 367f298a83b2..ebba88395bf8 100644 > > --- a/drivers/of/of_reserved_mem.c > > +++ b/drivers/of/of_reserved_mem.c > > @@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, > > > > *res_base = base; > > if (nomap) > > - return memblock_remove(base, size); > > + return memblock_mark_nomap(base, size); > > > > return memblock_reserve(base, size); > > } > > @@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void) > > pr_info("node %s compatible matching fail\n", > > rmem->name); > > if (nomap) > > - memblock_add(rmem->base, rmem->size); > > + memblock_clear_nomap(rmem->base, rmem->size); > > else > > memblock_free(rmem->base, rmem->size); > > } > > -- > > 2.25.1 > >
WARNING: multiple messages have this Message-ID (diff)
From: Quentin Perret <qperret@google.com> To: Rob Herring <robh+dt@kernel.org> Cc: Dong Aisheng <aisheng.dong@nxp.com>, Stephen Boyd <sboyd@kernel.org>, Nicolas Boichat <drinkcat@chromium.org>, KarimAllah Ahmed <karahmed@amazon.de>, linux-mm <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Dong Aisheng <dongas86@gmail.com>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Date: Tue, 22 Jun 2021 09:22:28 +0000 [thread overview] Message-ID: <YNGr1AlWV0AYnL1d@google.com> (raw) In-Reply-To: <CAL_JsqJMyY4iEcJi1z0o7pZdCASYHjnVjf6+fQDqa_ucb-M-MA@mail.gmail.com> On Friday 11 Jun 2021 at 11:10:36 (-0600), Rob Herring wrote: > On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng <aisheng.dong@nxp.com> wrote: > > > > Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"), > > nomap memory is changed to call memblock_mark_nomap() instead of > > memblock_remove(). But it only changed the reserved memory with fixed > > addr and size case in early_init_dt_reserve_memory_arch(), not > > including the dynamical allocation by size case in > > early_init_dt_alloc_reserved_memory_arch(). > > > > Cc: Rob Herring <robh+dt@kernel.org> > > Cc: devicetree@vger.kernel.org > > Good practice is to Cc the people involved in referenced commits. > Adding them now. This code is a minefield so I'd like other eyes on > it. Apologies for the delayed reply -- was away last week. I've been starring at this for 15 minutes, and still can't see how it could go wrong, so FWIW: Reviewed-by: Quentin Perret <qperret@google.com> Thanks, Quentin > > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> > > --- > > drivers/of/of_reserved_mem.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c > > index 367f298a83b2..ebba88395bf8 100644 > > --- a/drivers/of/of_reserved_mem.c > > +++ b/drivers/of/of_reserved_mem.c > > @@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, > > > > *res_base = base; > > if (nomap) > > - return memblock_remove(base, size); > > + return memblock_mark_nomap(base, size); > > > > return memblock_reserve(base, size); > > } > > @@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void) > > pr_info("node %s compatible matching fail\n", > > rmem->name); > > if (nomap) > > - memblock_add(rmem->base, rmem->size); > > + memblock_clear_nomap(rmem->base, rmem->size); > > else > > memblock_free(rmem->base, rmem->size); > > } > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-06-22 9:22 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-11 13:11 [PATCH 1/2] of: of_reserved_mem: only call memblock_free for normal reserved memory Dong Aisheng 2021-06-11 13:11 ` Dong Aisheng 2021-06-11 13:11 ` [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Dong Aisheng 2021-06-11 13:11 ` Dong Aisheng 2021-06-11 17:10 ` Rob Herring 2021-06-11 17:10 ` Rob Herring 2021-06-11 17:10 ` Rob Herring 2021-06-12 11:20 ` Aisheng Dong 2021-06-12 11:20 ` Aisheng Dong 2021-06-22 9:22 ` Quentin Perret [this message] 2021-06-22 9:22 ` Quentin Perret 2021-06-24 19:07 ` Rob Herring 2021-06-24 19:07 ` Rob Herring 2021-06-24 19:05 ` [PATCH 1/2] of: of_reserved_mem: only call memblock_free for normal reserved memory Rob Herring 2021-06-24 19:05 ` Rob Herring
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=YNGr1AlWV0AYnL1d@google.com \ --to=qperret@google.com \ --cc=aisheng.dong@nxp.com \ --cc=devicetree@vger.kernel.org \ --cc=dongas86@gmail.com \ --cc=drinkcat@chromium.org \ --cc=karahmed@amazon.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=robh+dt@kernel.org \ --cc=sboyd@kernel.org \ /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: linkBe 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.