From: Mike Rapoport <rppt@kernel.org>
To: DaeRo Lee <skseofh@gmail.com>
Cc: robh@kernel.org, saravanak@google.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Daero Lee <daero_le.lee@samsung.com>
Subject: Re: [PATCH] of: of_reserved_mem: clean-up reserved memory with no-map
Date: Mon, 29 Apr 2024 17:14:21 +0300 [thread overview]
Message-ID: <Zi-rPSnLX8zaueeY@kernel.org> (raw)
In-Reply-To: <CAATEi5kd-XeZ359De36oLJeVvALsEM7oJ9zez_M=zivwrQw5yA@mail.gmail.com>
On Sun, Apr 28, 2024 at 10:10:17PM +0900, DaeRo Lee wrote:
> 2024년 4월 28일 (일) 오후 9:55, <skseofh@gmail.com>님이 작성:
> >
> > From: Daero Lee <daero_le.lee@samsung.com>
> >
> > In early_init_dt_reserve_memory we only add memory w/o no-map flag to
> > memblock.reserved. But we need to add memory w/ no-map flag to
> > memblock.reserved, because NOMAP and memblock.reserved are semantically
> > different.
> >
> > Signed-off-by: Daero Lee <daero_le.lee@samsung.com>
> > ---
> > drivers/of/of_reserved_mem.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> > index 8236ecae2953..1c916da8adaf 100644
> > --- a/drivers/of/of_reserved_mem.c
> > +++ b/drivers/of/of_reserved_mem.c
> > @@ -91,7 +91,8 @@ static int __init early_init_dt_reserve_memory(phys_addr_t base,
> > memblock_is_region_reserved(base, size))
> > return -EBUSY;
> >
> > - return memblock_mark_nomap(base, size);
> > + if (memblock_mark_nomap(base, size))
> > + return;
> Sorry. The return value is wrong.
>
> Here is what I want to do:
>
> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -81,6 +81,7 @@ static void __init
> fdt_reserved_mem_save_node(unsigned long node, const char *un
> static int __init early_init_dt_reserve_memory(phys_addr_t base,
> phys_addr_t size, bool nomap)
> {
> + int err = 0;
> if (nomap) {
> /*
> * If the memory is already reserved (by another region), we
> @@ -91,7 +92,10 @@ static int __init
> early_init_dt_reserve_memory(phys_addr_t base,
> memblock_is_region_reserved(base, size))
> return -EBUSY;
>
> - return memblock_mark_nomap(base, size);
> +
> + err = memblock_mark_nomap(base, size);
> + if (err)
> + return err;
> }
> return memblock_reserve(base, size);
> }
Makes sense to me.
> Regards,
> DaeRo Lee
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2024-04-29 14:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-28 12:55 [PATCH] of: of_reserved_mem: clean-up reserved memory with no-map skseofh
2024-04-28 13:10 ` DaeRo Lee
2024-04-29 14:14 ` Mike Rapoport [this message]
2024-05-01 1:39 ` kernel test robot
2024-05-01 4:59 ` kernel test robot
2024-05-01 13:23 ` [PATCH v2] " skseofh
2024-05-22 14:31 ` Rob Herring
2024-05-24 9:32 ` DaeRo Lee
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=Zi-rPSnLX8zaueeY@kernel.org \
--to=rppt@kernel.org \
--cc=daero_le.lee@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=skseofh@gmail.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).