From 809de896085af9a86f53d38a67dfc89ffb41e76f Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Tue, 11 Mar 2025 22:42:24 +0200 Subject: [PATCH] arch/risc-v/src/common/riscv_mtimer.c: Correct mtimecmp setting in riscv_mtimer_cancel Set the compare register to maximum value, UINT64_MAX, which can be expected to be never reached Signed-off-by: Jukka Laitinen --- arch/risc-v/src/common/riscv_mtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/risc-v/src/common/riscv_mtimer.c b/arch/risc-v/src/common/riscv_mtimer.c index cc04169d18..4cbeeddd8a 100644 --- a/arch/risc-v/src/common/riscv_mtimer.c +++ b/arch/risc-v/src/common/riscv_mtimer.c @@ -362,7 +362,7 @@ static int riscv_mtimer_cancel(struct oneshot_lowerhalf_s *lower, mtime = riscv_mtimer_get_mtime(priv); - riscv_mtimer_set_mtimecmp(priv, mtime + UINT64_MAX); + riscv_mtimer_set_mtimecmp(priv, UINT64_MAX); nsec = (alarm - mtime) * NSEC_PER_SEC / priv->freq; ts->tv_sec = nsec / NSEC_PER_SEC;