From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Serge Semin" <fancer.lancer@gmail.com>
Cc: "paulburton@kernel.org" <paulburton@kernel.org>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 3/5] MIPS: Move mips_cm_probe after prom_init
Date: Wed, 08 May 2024 17:23:48 +0100 [thread overview]
Message-ID: <8d02a270-c9b7-4389-899e-cd755e55f0a4@app.fastmail.com> (raw)
In-Reply-To: <forgoxnzqnwreba7j57lgs6lgzny3zdnaqnpctr2qhtlcad3pg@l44sn4zf7hu3>
在2024年5月8日五月 下午1:50,Serge Semin写道:
> On Tue, May 07, 2024 at 10:01:51AM +0100, Jiaxun Yang wrote:
>> Move mips_cm_probe after prom_init so we can use fdt functions
>> in mips_cm_probe to obtain essential information.
>>
>> Impat for all systems that may have CM in system:
>
>> - geneirc: Adjusted code to accommodate this change
>
> s/geneirc/generic
>
>> - Lantiq: No impact, CM configuration won't be changed at all
>> - ralink: Called mips_cm_probe on it's own, in prom_init->prom_soc_init
>
>> - malta: No impact, CM address comes from CP0_CMGCR
>
> Are you sure about this? This was one of the problematic part I met
> back when was trying to implement the feature.
> arch/mips/mti-malta/malta-init.c:
> prom_init()
> +-> mips_cpc_probe()
> +-> mips_cpc_phys_base()
> +-> mips_cm_present(): mips_gcr_base != NULL
> +-> read_gcr_cpc_status()
> +-> read_gcr_cpc_base()
> +-> write_gcr_cpc_base()
>
> So by moving mips_cm_probe() to being executed after prom_init() the
> calls-chain above will be broken since the mips_gcr_base will be left
> uninitialized. Do I miss something?
Hi Serge,
Good catch! This is indeed a problem.
I tried to dig a little bit and found that a possible solution is to
move SMP initialization to device_tree_init(), as what generic platform
did.
I was able to test malta boot with this solution on my heavily patched
QEMU, I can confirm that both CM-SMP and scache are working as expected.
Will share my QEMU patches and configurations in next rev.
Thanks
- Jiaxun
>
> Please, note originally the mips_cm_probe() invocation was right
> above the Malta's mips_cpc_probe():
> 3af5a67c86a3 ("MIPS: Fix early CM probing")
>
> -Serge(y)
>
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> arch/mips/kernel/setup.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index 12a1a4ffb602..732579c8f4f8 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -773,8 +773,8 @@ static void __init setup_rng_seed(void)
>> void __init setup_arch(char **cmdline_p)
>> {
>> cpu_probe();
>> - mips_cm_probe();
>> prom_init();
>> + mips_cm_probe();
>>
>> setup_early_fdc_console();
>> #ifdef CONFIG_EARLY_PRINTK
>>
>> --
>> 2.34.1
>>
>>
--
- Jiaxun
next prev parent reply other threads:[~2024-05-08 16:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 9:01 [PATCH 0/5] MIPS: cm: Probe GCR address from devicetree Jiaxun Yang
2024-05-07 9:01 ` [PATCH 1/5] MIPS: generic: Do __dt_setup_arch in prom_init Jiaxun Yang
2024-05-07 9:01 ` [PATCH 2/5] MIPS: cm: Prefix probe functions with __init Jiaxun Yang
2024-05-07 9:01 ` [PATCH 3/5] MIPS: Move mips_cm_probe after prom_init Jiaxun Yang
2024-05-08 12:50 ` Serge Semin
2024-05-08 16:23 ` Jiaxun Yang [this message]
2024-05-07 9:01 ` [PATCH 4/5] dt-bindings: mips: Document mti,mips-cm Jiaxun Yang
2024-05-07 16:50 ` Conor Dooley
2024-05-07 18:16 ` Jiaxun Yang
2024-05-08 17:01 ` Conor Dooley
2024-05-08 20:28 ` Jiaxun Yang
2024-05-09 17:24 ` Conor Dooley
2024-05-07 9:01 ` [PATCH 5/5] MIPS: cm: Probe GCR address from DeviceTree Jiaxun Yang
2024-05-08 4:25 ` kernel test robot
2024-05-08 12:37 ` [PATCH 0/5] MIPS: cm: Probe GCR address from devicetree Serge Semin
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=8d02a270-c9b7-4389-899e-cd755e55f0a4@app.fastmail.com \
--to=jiaxun.yang@flygoat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paulburton@kernel.org \
--cc=robh@kernel.org \
--cc=tsbogend@alpha.franken.de \
/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