Linux-sh Archive mirror
 help / color / mirror / Atom feed
From: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
To: Artur Rojek <contact@artur-rojek.eu>
Cc: <dalias@libc.org>, <glaubitz@physik.fu-berlin.de>,
	<ysato@users.sourceforge.jp>, <kernel@quicinc.com>,
	<linux-kernel@vger.kernel.org>, <linux-sh@vger.kernel.org>,
	<robh+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [PATCH v5 2/2] sh: Restructure setup code to reserve memory regions earlier
Date: Thu, 10 Oct 2024 12:04:30 -0700	[thread overview]
Message-ID: <94b7090d-583e-4008-acc3-1aa87d2fe6fa@quicinc.com> (raw)
In-Reply-To: <aba64912a7cf700fd281016d4a2ad82d@artur-rojek.eu>


On 9/29/2024 2:15 PM, Artur Rojek wrote:
> On 2024-07-18 04:18, Oreoluwa Babatunde wrote:
>> The unflatten_device_tree() function contains a call to
>> memblock_alloc(). This is a problem because this allocation is done
>> before any of the reserved memory regions are set aside in
>> paging_init().
>> As a result, there is a possibility for memblock to unknowingly allocate
>> from any of the memory regions that are meant to be reserved.
>>
>> Hence, restructure the setup code to reserve the memory regions before
>> any allocation is done by the unflatten_devicetree*() using memblock.
>>
>> Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
>
> Hi Oreoluwa,
>
>> ---
>>  arch/sh/mm/init.c | 15 +++++++--------
>>  1 file changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
>> index 643e3617c6a6..857ce8cc84bd 100644
>> --- a/arch/sh/mm/init.c
>> +++ b/arch/sh/mm/init.c
>> @@ -249,6 +249,7 @@ void __init early_reserve_mem(void)
>>      u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
>>      u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET;
>>
>> +    sh_mv.mv_mem_init();
>
> One side effect of moving mv_mem_init here is that it makes cache
> operations available earlier. But I see no harm in doing that.
>
> Otherwise the patch is looking good. Verified on J2 Turtle Board.
>
> Reviewed-by: Artur Rojek <contact@artur-rojek.eu>
>
ack.

Thank you for the review Artur!

Regards,
Oreoluwa


  reply	other threads:[~2024-10-10 19:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-18  2:18 [PATCH v5 0/2] sh: Restructure setup code to reserve memory regions earlier Oreoluwa Babatunde
2024-07-18  2:18 ` [PATCH v5 1/2] sh: Restructure call site for early_reserve_mem() Oreoluwa Babatunde
2024-09-29 20:34   ` Artur Rojek
2024-07-18  2:18 ` [PATCH v5 2/2] sh: Restructure setup code to reserve memory regions earlier Oreoluwa Babatunde
2024-09-29 21:15   ` Artur Rojek
2024-10-10 19:04     ` Oreoluwa Babatunde [this message]
2024-09-26 12:41 ` [PATCH v5 0/2] " John Paul Adrian Glaubitz

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=94b7090d-583e-4008-acc3-1aa87d2fe6fa@quicinc.com \
    --to=quic_obabatun@quicinc.com \
    --cc=contact@artur-rojek.eu \
    --cc=dalias@libc.org \
    --cc=geert+renesas@glider.be \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=kernel@quicinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=robh+dt@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).