linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	<ysato@users.sourceforge.jp>, <dalias@libc.org>
Cc: <akpm@linux-foundation.org>, <linux-sh@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <robh+dt@kernel.org>,
	<kernel@quicinc.com>, Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v2] sh: Call paging_init() earlier in the init sequence
Date: Mon, 29 Apr 2024 09:28:30 -0700	[thread overview]
Message-ID: <b7296e60-1911-4302-b472-b0ae11cd3d87@quicinc.com> (raw)
In-Reply-To: <6ba5b226dfcbae3d9c789bb6943089621b315d65.camel@physik.fu-berlin.de>


On 4/29/2024 2:03 AM, John Paul Adrian Glaubitz wrote:
> Hi Oreoluwa,
>
> On Tue, 2024-04-23 at 16:31 -0700, 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 is set aside in paging_init().
>> This means that there is a possibility for memblock to allocate from
>> any of the memory regions that are supposed to be set aside as reserved.
>>
>> Hence, move the call to paging_init() to be earlier in the init
>> sequence so that the reserved memory regions are set aside before any
>> allocations are done using memblock.
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
>> ---
>> v2:
>> - Added Rob Herrings Reviewed-by.
>> - cc Andrew Morton to assist with merging this for sh architecture.
>>   Similar change made for loongarch and openrisc in v1 have already
>>   been merged.
> Could you link the changes for references so I can have a look?
Hi John,

Here are links to the corresponding changes on Loongarch and Openrisc.

- Loongarch:
https://lore.kernel.org/all/20240218151403.2206980-1-chenhuacai@loongson.cn/

- Openrisc:
https://lore.kernel.org/all/1707524971-146908-3-git-send-email-quic_obabatun@quicinc.com/


Thank you!
Oreoluwa
>
>> v1:
>> https://lore.kernel.org/all/1707524971-146908-4-git-send-email-quic_obabatun@quicinc.com/
>>
>>  arch/sh/kernel/setup.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
>> index 620e5cf8ae1e..98c8473e130d 100644
>> --- a/arch/sh/kernel/setup.c
>> +++ b/arch/sh/kernel/setup.c
>> @@ -322,6 +322,8 @@ void __init setup_arch(char **cmdline_p)
>>  	/* Let earlyprintk output early console messages */
>>  	sh_early_platform_driver_probe("earlyprintk", 1, 1);
>>  
>> +	paging_init();
>> +
>>  #ifdef CONFIG_OF_EARLY_FLATTREE
>>  #ifdef CONFIG_USE_BUILTIN_DTB
>>  	unflatten_and_copy_device_tree();
>> @@ -330,8 +332,6 @@ void __init setup_arch(char **cmdline_p)
>>  #endif
>>  #endif
>>  
>> -	paging_init();
>> -
>>  	/* Perform the machine specific initialisation */
>>  	if (likely(sh_mv.mv_setup))
>>  		sh_mv.mv_setup(cmdline_p);
> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>
> Adrian
>

  reply	other threads:[~2024-04-29 16:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 23:31 [PATCH v2] sh: Call paging_init() earlier in the init sequence Oreoluwa Babatunde
2024-04-24  4:47 ` John Paul Adrian Glaubitz
2024-04-24  8:45 ` Markus Elfring
2024-04-24 10:24   ` John Paul Adrian Glaubitz
2024-04-24 11:06     ` [v2] " Markus Elfring
2024-04-29  9:03 ` [PATCH v2] " John Paul Adrian Glaubitz
2024-04-29 16:28   ` Oreoluwa Babatunde [this message]
2024-04-29 17:26     ` John Paul Adrian Glaubitz
2024-04-29 17:54       ` Oreoluwa Babatunde
2024-05-01 17:18 ` John Paul Adrian Glaubitz
2024-05-02 10:29   ` John Paul Adrian Glaubitz
2024-05-07 21:42     ` Oreoluwa Babatunde
2024-05-07 22:41       ` John Paul Adrian Glaubitz
2024-05-20 18:03         ` Oreoluwa Babatunde
2024-05-20 18:24           ` John Paul Adrian Glaubitz
2024-05-20 18:49             ` 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=b7296e60-1911-4302-b472-b0ae11cd3d87@quicinc.com \
    --to=quic_obabatun@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=dalias@libc.org \
    --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=robh@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 NNTP newsgroup(s).