From: Yunhui Cui <cuiyunhui@bytedance.com>
To: paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, cuiyunhui@bytedance.com,
conor.dooley@microchip.com, robh@kernel.org,
sudeep.holla@arm.com, pierre.gondois@arm.com,
suagrfillet@gmail.com, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] RISC-V: cacheinfo: add init_cache_level()
Date: Mon, 22 Jan 2024 09:35:10 +0800 [thread overview]
Message-ID: <20240122013510.55788-1-cuiyunhui@bytedance.com> (raw)
When cacheinfo_sysfs_init() is executed, the general weak function
init_cache_level() returns -ENOENT, causing failure to add the "cache"
node to /sys/devices/system/cpu/cpux/. Implement the init_cache_level()
function on RISC-V to fix it.
Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
arch/riscv/kernel/cacheinfo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
index 09e9b88110d1..be9169a38bac 100644
--- a/arch/riscv/kernel/cacheinfo.c
+++ b/arch/riscv/kernel/cacheinfo.c
@@ -71,6 +71,12 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
this_leaf->type = type;
}
+int init_cache_level(unsigned int cpu)
+{
+ /* The topology has been parsed by acpi or dt, return true. */
+ return 0;
+}
+
int populate_cache_leaves(unsigned int cpu)
{
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
--
2.20.1
next reply other threads:[~2024-01-22 1:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 1:35 Yunhui Cui [this message]
2024-01-22 8:09 ` Conor Dooley
2024-01-22 8:32 ` [External] " yunhui cui
2024-01-22 8:55 ` Conor Dooley
2024-01-22 10:57 ` yunhui cui
2024-01-22 17:02 ` Sudeep Holla
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=20240122013510.55788-1-cuiyunhui@bytedance.com \
--to=cuiyunhui@bytedance.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pierre.gondois@arm.com \
--cc=robh@kernel.org \
--cc=suagrfillet@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®