Skip to content

Commit a56fee6

Browse files
nordic-krchanangl
authored andcommitted
[nrf fromtree] drivers: timer: nrf_grtc_timer: Fix for random hangs
d599e2b 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 <[email protected]> (cherry picked from commit af3c8b9)
1 parent 4ad051d commit a56fee6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/timer/nrf_grtc_timer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte
140140
ARG_UNUSED(id);
141141
ARG_UNUSED(p_context);
142142
uint64_t dticks;
143+
uint64_t now = counter();
144+
145+
if (unlikely(now < cc_val)) {
146+
return;
147+
}
143148

144149
dticks = counter_sub(cc_val, last_count) / CYC_PER_TICK;
145150

0 commit comments

Comments
 (0)