This is a note to let you know that I've just added the patch titled clocksource/drivers/timer-riscv: Clear timer interrupt on timer initialization to the 6.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: clocksource-drivers-timer-riscv-clear-timer-interrup.patch and it can be found in the queue-6.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit b82e450b5008bcc2b72c088af15f075a7abb2ae8 Author: Ley Foon Tan <leyfoon.tan@xxxxxxxxxxxxxxxx> Date: Thu Mar 7 01:23:30 2024 +0800 clocksource/drivers/timer-riscv: Clear timer interrupt on timer initialization [ Upstream commit 8248ca30ef89f9cc74ace62ae1b9a22b5f16736c ] In the RISC-V specification, the stimecmp register doesn't have a default value. To prevent the timer interrupt from being triggered during timer initialization, clear the timer interrupt by writing stimecmp with a maximum value. Fixes: 9f7a8ff6391f ("RISC-V: Prefer sstc extension if available") Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Ley Foon Tan <leyfoon.tan@xxxxxxxxxxxxxxxx> Reviewed-by: Samuel Holland <samuel.holland@xxxxxxxxxx> Tested-by: Samuel Holland <samuel.holland@xxxxxxxxxx> Reviewed-by: Atish Patra <atishp@xxxxxxxxxxxx> Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240306172330.255844-1-leyfoon.tan@xxxxxxxxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 57857c0dfba97..1c732479a2c8d 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -101,6 +101,9 @@ static int riscv_timer_starting_cpu(unsigned int cpu) { struct clock_event_device *ce = per_cpu_ptr(&riscv_clock_event, cpu); + /* Clear timer interrupt */ + riscv_clock_event_stop(); + ce->cpumask = cpumask_of(cpu); ce->irq = riscv_clock_event_irq; if (riscv_timer_cannot_wake_cpu)