From: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
To: Rob Herring <robh@kernel.org>
Cc: <catalin.marinas@arm.com>, <will@kernel.org>,
<frowand.list@gmail.com>, <dinguyen@kernel.org>,
<chenhuacai@kernel.org>, <tsbogend@alpha.franken.de>,
<jonas@southpole.se>, <stefan.kristiansson@saunalahti.fi>,
<shorne@gmail.com>, <mpe@ellerman.id.au>,
<ysato@users.sourceforge.jp>, <dalias@libc.org>,
<glaubitz@physik.fu-berlin.de>, <richard@nod.at>,
<anton.ivanov@cambridgegreys.com>, <johannes@sipsolutions.net>,
<chris@zankel.net>, <jcmvbkbc@gmail.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>, <kernel@quicinc.com>
Subject: Re: [RFC PATCH v2 2/6] of: reserved_mem: Swicth call to unflatten_device_tree() to after paging_init()
Date: Sun, 10 Dec 2023 16:51:56 -0800 [thread overview]
Message-ID: <2db0f02f-b15d-4767-8b7e-9051a46707d0@quicinc.com> (raw)
In-Reply-To: <20231206213110.GA3345785-robh@kernel.org>
On 12/6/2023 1:31 PM, Rob Herring wrote:
> On Mon, Dec 04, 2023 at 10:54:05AM -0800, Oreoluwa Babatunde wrote:
>> Switch call to unflatten_device_tree() to after paging_init() on other
>> archs to follow new order in which the reserved_mem regions are
>> processed.
> You did this so that you could allocate memory for the reserved regions.
> But unflatten_device_tree() can already do allocations using memblock.
> So the same thing should work for you.
>
> I suspect that moving this will break any arch that called an of_* API
> between the original call and the new call location.
>
> Rob
Hi Rob,
Thank you for your feedback. You are correct, I see that
unflatten_device_tree() is allocating memory from memblock and writing
to it before paging_init() is called on these other architectures.
This series will still require fdt_init_reserved_mem() to be called
after paging_init() on architectures such as arm64 which require
paging_init() to run before memblock allocated memory is writable.
In light of this, there seems to be no non-architecture-specific
universal calling point to stick in fdt_init_reserved_mem() that works
for all architectures. Therefore, I propose taking out the call to
fdt_init_reserved_mem() from the unflatten_device_tree() function and
placing it in the setup_arch() function for each architecture.
(similar to the way it was in v1 of this series).
Doing this will allow us to place fdt_init_reserved_mem() after
paging_init() on architectures that require paging_init() to be called
before memblock allocated memory is writable, and place it before
paging_init() on architectures that does not require paging_init() to be
called before writing to memblock allocated memory.
fdt_init_reserved_mem() can also be called after unflatten_device_tree()
on all architectures to ensure we get the speed benefits of using the
unflattened device tree APIs for the final pass.
Regards,
Oreoluwa
next prev parent reply other threads:[~2023-12-11 1:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 18:54 [RFC PATCH v2 0/6] Dynamic allocation of reserved_mem array Oreoluwa Babatunde
2023-12-04 18:54 ` [RFC PATCH v2 1/6] of: reserved_mem: Change the order that reserved_mem regions are stored Oreoluwa Babatunde
2023-12-04 18:54 ` [RFC PATCH v2 2/6] of: reserved_mem: Swicth call to unflatten_device_tree() to after paging_init() Oreoluwa Babatunde
2023-12-06 21:31 ` Rob Herring
2023-12-11 0:51 ` Oreoluwa Babatunde [this message]
2023-12-04 18:54 ` [RFC PATCH v2 3/6] of: resevred_mem: Delay allocation of memory for dynamic regions Oreoluwa Babatunde
2023-12-04 18:54 ` [RFC PATCH v2 4/6] of: reserved_mem: Add code to use unflattened DT for reserved_mem nodes Oreoluwa Babatunde
2023-12-04 18:54 ` [RFC PATCH v2 5/6] of: reserved_mem: Add code to dynamically allocate reserved_mem array Oreoluwa Babatunde
2023-12-04 18:54 ` [RFC PATCH v2 6/6] of: reserved_mem: Make MAX_RESERVED_REGIONS a config option Oreoluwa Babatunde
2023-12-06 21:35 ` [RFC PATCH v2 0/6] Dynamic allocation of reserved_mem array Rob Herring
2023-12-11 0:42 ` Oreoluwa Babatunde
-- strict thread matches above, loose matches on Subject: below --
2023-12-04 4:13 Oreoluwa Babatunde
2023-12-04 4:13 ` [RFC PATCH v2 2/6] of: reserved_mem: Swicth call to unflatten_device_tree() to after paging_init() Oreoluwa Babatunde
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=2db0f02f-b15d-4767-8b7e-9051a46707d0@quicinc.com \
--to=quic_obabatun@quicinc.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=chris@zankel.net \
--cc=dalias@libc.org \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@kernel.org \
--cc=frowand.list@gmail.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=jcmvbkbc@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=jonas@southpole.se \
--cc=kernel@quicinc.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=shorne@gmail.com \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=tsbogend@alpha.franken.de \
--cc=will@kernel.org \
--cc=ysato@users.sourceforge.jp \
/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
all inboxes | Powered by JetHome®