From: Alexandre Ghiti <alex@ghiti.fr>
To: liu.xuemei1@zte.com.cn, paul.walmsley@sifive.com
Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, spersvold@gmail.com,
sudeep.holla@arm.com, mikisabate@gmail.com, robh@kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: cacheinfo: init cache levels via fetch_cache_info when SMP disabled
Date: Thu, 31 Jul 2025 15:29:01 +0200 [thread overview]
Message-ID: <d339833a-5784-407b-816d-ab95d35fbe4e@ghiti.fr> (raw)
In-Reply-To: <20250725104425229ArF_W-F7CmscLJKs0yoiQ@zte.com.cn>
Hi Jessica,
On 7/25/25 04:44, liu.xuemei1@zte.com.cn wrote:
> From: Jessica Liu <liu.xuemei1@zte.com.cn>
>
> As described in commit 1845d381f280 ("riscv: cacheinfo: Add back
> init_cache_level() function"), when CONFIG_SMP is undefined, the cache
> hierarchy detection needs to be performed through the init_cache_level(),
> whereas when CONFIG_SMP is defined, this detection is handled during the
> init_cpu_topology() process.
>
> Furthermore, while commit 66381d36771e ("RISC-V: Select ACPI PPTT drivers")
> enables cache information retrieval through the ACPI PPTT table, the
> init_of_cache_level() called within init_cache_level() cannot support cache
> hierarchy detection through ACPI PPTT. Therefore, when CONFIG_SMP is
> undefined, we directly invoke the fetch_cache_info function to initialize
> the cache levels.
>
> Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
> ---
> arch/riscv/kernel/cacheinfo.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> index 26b085dbdd07..f81ca963d177 100644
> --- a/arch/riscv/kernel/cacheinfo.c
> +++ b/arch/riscv/kernel/cacheinfo.c
> @@ -73,7 +73,11 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
>
> int init_cache_level(unsigned int cpu)
> {
> - return init_of_cache_level(cpu);
> +#ifdef CONFIG_SMP
> + return 0;
> +#endif
> +
> + return fetch_cache_info(cpu);
> }
>
> int populate_cache_leaves(unsigned int cpu)
Is the current behaviour wrong or just redundant? If wrong, I'll add a
Fixes tag to backport, otherwise I won't.
Thanks,
Alex
next prev parent reply other threads:[~2025-07-31 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 2:44 liu.xuemei1
2025-07-31 13:29 ` Alexandre Ghiti [this message]
2025-08-01 1:32 ` liu.xuemei1
2025-08-01 11:45 ` Alexandre Ghiti
2025-08-05 8:50 ` Alexandre Ghiti
2025-08-14 1:29 ` liu.xuemei1
2025-08-14 8:16 ` Alexandre Ghiti
2025-09-02 6:55 ` Alexandre Ghiti
2025-09-03 1:42 ` liu.xuemei1
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=d339833a-5784-407b-816d-ab95d35fbe4e@ghiti.fr \
--to=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=liu.xuemei1@zte.com.cn \
--cc=mikisabate@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=spersvold@gmail.com \
--cc=sudeep.holla@arm.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
all inboxes | Powered by JetHome®