From: Rob Herring <robh+dt@kernel.org>
To: Dong Aisheng <aisheng.dong@nxp.com>,
Quentin Perret <qperret@google.com>,
Stephen Boyd <sboyd@kernel.org>,
Nicolas Boichat <drinkcat@chromium.org>,
KarimAllah Ahmed <karahmed@amazon.de>
Cc: 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: Fri, 11 Jun 2021 11:10:36 -0600 [thread overview]
Message-ID: <CAL_JsqJMyY4iEcJi1z0o7pZdCASYHjnVjf6+fQDqa_ucb-M-MA@mail.gmail.com> (raw)
In-Reply-To: <20210611131153.3731147-2-aisheng.dong@nxp.com>
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.
> 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
>
next prev parent reply other threads:[~2021-06-11 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210611131153.3731147-1-aisheng.dong@nxp.com>
2021-06-24 19:05 ` [PATCH 1/2] of: of_reserved_mem: only call memblock_free for normal reserved memory Rob Herring
[not found] ` <20210611131153.3731147-2-aisheng.dong@nxp.com>
2021-06-11 17:10 ` Rob Herring [this message]
2021-06-12 11:20 ` [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Aisheng Dong
2021-06-22 9:22 ` Quentin Perret
2021-06-24 19:07 ` 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=CAL_JsqJMyY4iEcJi1z0o7pZdCASYHjnVjf6+fQDqa_ucb-M-MA@mail.gmail.com \
--to=robh+dt@kernel.org \
--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=qperret@google.com \
--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: 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