Skip to content

Commit 70c93b0

Browse files
nick650823Alexandre Ghiti
authored andcommitted
clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
Stop the timer when the cpu is going to be offline otherwise the timer interrupt may be pending while performing power-down. Suggested-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/lkml/20240829033904.477200-3-nick.hu@sifive.com/T/#u Signed-off-by: Nick Hu <nick.hu@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250219114135.27764-3-nick.hu@sifive.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent ffef54a commit 70c93b0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/clocksource/timer-riscv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ static int riscv_timer_starting_cpu(unsigned int cpu)
126126

127127
static int riscv_timer_dying_cpu(unsigned int cpu)
128128
{
129+
/*
130+
* Stop the timer when the cpu is going to be offline otherwise
131+
* the timer interrupt may be pending while performing power-down.
132+
*/
133+
riscv_clock_event_stop();
129134
disable_percpu_irq(riscv_clock_event_irq);
135+
130136
return 0;
131137
}
132138

0 commit comments

Comments
 (0)