diff mbox series

[v1] RISC-V: drop error print from riscv_hartid_to_cpuid()

Message ID 20230629-paternity-grafted-b901b76d04a0@wendy (mailing list archive)
State Accepted
Commit 52909f1768023656d5c429873e2246a134289a95
Headers show
Series [v1] RISC-V: drop error print from riscv_hartid_to_cpuid() | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 488833ccdcac
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 6 and now 6
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 8 this patch: 8
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 8 this patch: 8
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 20 this patch: 20
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success Fixes tag looks correct
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Conor Dooley June 29, 2023, 11:33 a.m. UTC
As of commit 2ac874343749 ("RISC-V: split early & late of_node to
hartid mapping") my CI complains about newly added pr_err() messages
during boot, for example:
[    0.000000] Couldn't find cpu id for hartid [0]
[    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller

Before the split, riscv_of_processor_hartid() contained a check for
whether the cpu was "available", before calling riscv_hartid_to_cpuid(),
but after the split riscv_of_processor_hartid() can be called for cpus
that are disabled.

Most callers of riscv_hartid_to_cpuid() already report custom errors
where it falls, making this print superfluous in those case. In other
places, the print adds nothing - see riscv_intc_init() for example.

Fixes: 2ac874343749 ("RISC-V: split early & late of_node to hartid mapping")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
Sunil, the acpi user of this function I was unclear about. Could you
please take a look and see if disabling this print is okay there, or if I
should add a localised error print on failure?

CC: Sunil V L <sunilvl@ventanamicro.com>
CC: Andrew Jones <ajones@ventanamicro.com>
CC: Paul Walmsley <paul.walmsley@sifive.com>
CC: Palmer Dabbelt <palmer@dabbelt.com>
CC: linux-riscv@lists.infradead.org
---
 arch/riscv/kernel/smp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Palmer Dabbelt July 5, 2023, 11:38 p.m. UTC | #1
On Thu, 29 Jun 2023 12:33:34 +0100, Conor Dooley wrote:
> As of commit 2ac874343749 ("RISC-V: split early & late of_node to
> hartid mapping") my CI complains about newly added pr_err() messages
> during boot, for example:
> [    0.000000] Couldn't find cpu id for hartid [0]
> [    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller
> 
> Before the split, riscv_of_processor_hartid() contained a check for
> whether the cpu was "available", before calling riscv_hartid_to_cpuid(),
> but after the split riscv_of_processor_hartid() can be called for cpus
> that are disabled.
> 
> [...]

Applied, thanks!

[1/1] RISC-V: drop error print from riscv_hartid_to_cpuid()
      https://git.kernel.org/palmer/c/52909f176802

Best regards,
patchwork-bot+linux-riscv@kernel.org July 5, 2023, 11:50 p.m. UTC | #2
Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Thu, 29 Jun 2023 12:33:34 +0100 you wrote:
> As of commit 2ac874343749 ("RISC-V: split early & late of_node to
> hartid mapping") my CI complains about newly added pr_err() messages
> during boot, for example:
> [    0.000000] Couldn't find cpu id for hartid [0]
> [    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller
> 
> Before the split, riscv_of_processor_hartid() contained a check for
> whether the cpu was "available", before calling riscv_hartid_to_cpuid(),
> but after the split riscv_of_processor_hartid() can be called for cpus
> that are disabled.
> 
> [...]

Here is the summary with links:
  - [v1] RISC-V: drop error print from riscv_hartid_to_cpuid()
    https://git.kernel.org/riscv/c/52909f176802

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index 23e533766a49..85bbce0f758c 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -58,7 +58,6 @@  int riscv_hartid_to_cpuid(unsigned long hartid)
 		if (cpuid_to_hartid_map(i) == hartid)
 			return i;
 
-	pr_err("Couldn't find cpu id for hartid [%lu]\n", hartid);
 	return -ENOENT;
 }