diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c index bcd3e76ba1dad..94e220ed1a3ce 100644 --- a/arch/riscv/kernel/time.c +++ b/arch/riscv/kernel/time.c @@ -35,6 +35,12 @@ void riscv_timer_interrupt(void) */ struct clock_event_device *evdev = this_cpu_ptr(&riscv_clock_event); + /* + * There are no direct SBI calls to clear pending timer interrupt bit. + * Disable timer interrupt to ignore pending interrupt until next + * interrupt. + */ + csr_clear(sie, SIE_STIE); evdev->event_handler(evdev); #endif } diff --git a/drivers/clocksource/riscv_timer.c b/drivers/clocksource/riscv_timer.c index 8b45af2cd76e3..f4147db31ddcc 100644 --- a/drivers/clocksource/riscv_timer.c +++ b/drivers/clocksource/riscv_timer.c @@ -38,6 +38,7 @@ static int next_event(unsigned long delta, struct clock_event_device *ce) * harts. */ BUG_ON(ce != this_cpu_ptr(&riscv_clock_event)); + csr_set(sie, SIE_STIE); sbi_set_timer(get_cycles64() + delta); return 0; }