RISC-V: Don't print details of CPUs disabled in DT
PATCH 1/1 RISC-V: Don't print details of CPUs disabled in DT
Early boot stages may disable CPU DT nodes for unavailable CPUs based on SKU, pinstraps, eFuse, etc. Currently, the riscv_early_of_processor_hartid() prints details of a CPU if it is disabled in DT which has no value and gives a false impression to the users that there some issue with the CPU.
--- arch/riscv/kernel/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/riscv/kernel/cpu.c +1 -3
@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned loreturn -ENODEV ; } -if (!of_device_is_available (node)) { -pr_info ("CPU with hartid=%lu is not available\n" , *hart); +if (!of_device_is_available (node))return -ENODEV ; - }if (of_property_read_string (node,"riscv,isa-base" , &isa)) goto old_interface;
Signature · 1 line
2.43.0
Quoted 32 lines · Anup Patel
Early boot stages may disable CPU DT nodes for unavailable CPUs based on SKU, pinstraps, eFuse, etc. Currently, the
riscv_early_of_processor_hartid()prints details of a CPU if it is disabled in DT which has no value and gives a false impression to the users that there some issue with the CPU.Fixes e3d794d555cd ("riscv: treat cpu devicetree nodes without status as enabled")Signed-off-by Anup Patel <[email protected]>--- arch/riscv/kernel/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/riscv/kernel/cpu.c +1
-3@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned loreturn -ENODEV ; } -if (!of_device_is_available (node)) { -pr_info ("CPU with hartid=%lu is not available\n" , *hart); +if (!of_device_is_available (node))return -ENODEV ; - }if (of_property_read_string (node,"riscv,isa-base" , &isa)) goto old_interface;Signature · 1 line
2.43.0
Maybe we should keep the message as a pr_debug()?
Otherwise,
Conor Dooley
Reviewed-byQuoted 28 lines · Andrew Jones
Quoted 27 lines · Anup Patel
Early boot stages may disable CPU DT nodes for unavailable CPUs based on SKU, pinstraps, eFuse, etc. Currently, the
riscv_early_of_processor_hartid()prints details of a CPU if it is disabled in DT which has no value and gives a false impression to the users that there some issue with the CPU.Fixes e3d794d555cd ("riscv: treat cpu devicetree nodes without status as enabled")Signed-off-by Anup Patel <[email protected]>--- arch/riscv/kernel/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/riscv/kernel/cpu.c +1
-3@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned loreturn -ENODEV ; } -if (!of_device_is_available (node)) { -pr_info ("CPU with hartid=%lu is not available\n" , *hart); +if (!of_device_is_available (node))return -ENODEV ; - }
Quoted 7 lines
Quoted 5 lines
arch/riscv/kernel/cpu.c +0
-0if (of_property_read_string (node,"riscv,isa-base" , &isa)) goto old_interface;Signature · 1 line
2.43.0Maybe we should keep the message as a
pr_debug()?
I don't even know if that really has any value, there's plenty of places in userspace to get access to what CPUs are enabled and having no CPUs triggers a BUG().
Quoted 4 lines
Otherwise,
Reviewed-by Andrew Jones <[email protected]>
This patch was applied to riscv/linux.git (fixes) by Paul Walmsley <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Paul Walmsley <[email protected]>:
Quoted 8 lines · On Tue, 14 Oct 2025 22:00:09 +0530 you wrote:
Early boot stages may disable CPU DT nodes for unavailable CPUs based on SKU, pinstraps, eFuse, etc. Currently, the
riscv_early_of_processor_hartid()prints details of a CPU if it is disabled in DT which has no value and gives a false impression to the users that there some issue with the CPU.[...]
Here is the summary with links:
- RISC-V: Don't print details of CPUs disabled in DT
https://git.kernel.org/riscv/c/d2721bb165b3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html