]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Align SBI probe implementation with spec
authorAndrew Jones <ajones@ventanamicro.com>
Thu, 27 Apr 2023 16:36:26 +0000 (18:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:04 +0000 (23:03 +0900)
commit2830e7e3fbecbc4914998ead1347b7d582791730
tree15d7cc15a5b82d5ac3e24c3f8c374d45cfec8f3f
parent34a199ef7ace6ef1a60e2ba435fd6bd96c6f6d3f
RISC-V: Align SBI probe implementation with spec

commit 41cad8284d5e6bf1d49d3c10a6b52ee1ae866a20 upstream.

sbi_probe_extension() is specified with "Returns 0 if the given SBI
extension ID (EID) is not available, or 1 if it is available unless
defined as any other non-zero value by the implementation."
Additionally, sbiret.value is a long. Fix the implementation to
ensure any nonzero long value is considered a success, rather
than only positive int values.

Fixes: 62151ddae199 ("RISC-V: Add basic support for SBI v0.2")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230427163626.101042-1-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/include/asm/sbi.h
arch/riscv/kernel/cpu_ops.c
arch/riscv/kernel/sbi.c
arch/riscv/kvm/main.c
drivers/cpuidle/cpuidle-riscv-sbi.c
drivers/perf/riscv_pmu_sbi.c