]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource/drivers/riscv: Patch riscv_clock_next_event() jump before first use
authorMatt Evans <mev@rivosinc.com>
Wed, 1 Feb 2023 19:49:42 +0000 (19:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:03 +0000 (09:33 +0100)
commit302082c6f8b05abdf5d8d14a7bd1a58b8ec3409d
tree8a46a3db8740ec91ee8668562644d8826ed1b02f
parent260696722ee20105cdf4cf9d9998b709583fdcf3
clocksource/drivers/riscv: Patch riscv_clock_next_event() jump before first use

[ Upstream commit c5ee515108edf425f855103abb98a2fa2cdd2d67 ]

A static key is used to select between SBI and Sstc timer usage in
riscv_clock_next_event(), but currently the direction is resolved
after cpuhp_setup_state() is called (which sets the next event).  The
first event will therefore fall through the sbi_set_timer() path; this
breaks Sstc-only systems.  So, apply the jump patching before first
use.

Fixes: 262c5b36f68d ("RISC-V: Prefer sstc extension if available")
Signed-off-by: Matt Evans <mev@rivosinc.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/CDDAB2D0-264E-42F3-8E31-BA210BEB8EC1@rivosinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-riscv.c