drivers: timer: nrf_grtc_timer: Fix for random system hangs

d599e2b670 removed early return from sys_clock_timeout_handler if
current counter value is less than cc_val. It seems that this return is
needed as after the removal some stress tests which were using system
timers heavily started to hang.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2024-05-22 07:39:21 +02:00 committed by Anas Nashif
commit af3c8b973e

View file

@ -184,6 +184,11 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte
ARG_UNUSED(id);
ARG_UNUSED(p_context);
uint64_t dticks;
uint64_t now = counter();
if (unlikely(now < cc_val)) {
return;
}
dticks = counter_sub(cc_val, last_count) / CYC_PER_TICK;