summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAndrew Jones <ajones@ventanamicro.com>2023-04-26 17:13:32 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2023-04-26 18:58:33 +0300
commit08dc107594681040587c23a097cfa678e51f5af2 (patch)
tree10fb0eef0fe5ab93b94e3f5e6a792052d6a4c938 /arch
parent26e7aacb83dfd04330673c5c9ac336560da52bb3 (diff)
downloadlinux-08dc107594681040587c23a097cfa678e51f5af2.tar.xz
RISC-V: hwprobe: There can only be one first
Only capture the first cpu_id in order for the comparison below to be of any use. Fixes: ea3de9ce8aa2 ("RISC-V: Add a syscall for HW probing") Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Evan Green <evan@rivosinc.com> Link: https://lore.kernel.org/r/20230426141333.10063-2-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/kernel/sys_riscv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index 849b4170629d..c569dac7452e 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -103,8 +103,10 @@ static void hwprobe_arch_id(struct riscv_hwprobe *pair,
break;
}
- if (first)
+ if (first) {
id = cpu_id;
+ first = false;
+ }
/*
* If there's a mismatch for the given set, return -1 in the