Skip to contentSkip to conversation

RISC-V: Don't print details of CPUs disabled in DT

PATCH Applied Anup Patel 4 participants 4 messages Oct 14, 2025 – Oct 18, 2025 RISC-V

lore
Share & tools
lore

Anup Patel

author
#0 lore raw

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.

Fixes e3d794d555cd ("riscv: treat cpu devicetree nodes without status as enabled")
---
 arch/riscv/kernel/cpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/riscv/kernel/cpu.c +1 -3
index f6b13e9f5e6c..3dbc8cc557dd 100644
@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo
 		return -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
Reviewed-by on v1 1/1
#1 lore raw
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")
---
 arch/riscv/kernel/cpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/riscv/kernel/cpu.c +1 -3
index f6b13e9f5e6c..3dbc8cc557dd 100644
@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo
 		return -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,

Reviewed-by
#2 lore raw
Quoted 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")
---
 arch/riscv/kernel/cpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/riscv/kernel/cpu.c +1 -3
index f6b13e9f5e6c..3dbc8cc557dd 100644
@@ -62,10 +62,8 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo
 		return -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 -0
 	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()?

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,

#3 lore raw
In reply to Anup Patel
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