From 8e4af4011a11fd2e72ae4d5c0694f9a4a9b1f0dd Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Wed, 15 Feb 2023 17:03:23 +0800 Subject: [PATCH] module: timer: re-enable timer in isr if no alarm 32 bits timer uses interrupt to support 64 bits counter Signed-off-by: Joe Zhu --- module/timer/src/mod_timer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/timer/src/mod_timer.c b/module/timer/src/mod_timer.c index f65f27d35..dbf6f0b11 100644 --- a/module/timer/src/mod_timer.c +++ b/module/timer/src/mod_timer.c @@ -557,8 +557,14 @@ static void timer_isr(uintptr_t ctx_ptr) (struct alarm_sub_element_ctx *)fwk_list_pop_head(&ctx->alarms_active); if (alarm == NULL) { - /* Timer interrupt triggered without any alarm in the active queue */ - fwk_unexpected(); + /* + * 32 bits timer need interrupt to maintain 64 bits counter. + * just re-enable timer if no alarm in the active queue + */ + status = ctx->driver->enable(ctx->driver_dev_id); + if (status != FWK_SUCCESS) { + FWK_LOG_DEBUG("[Timer] %s @%d", __func__, __LINE__); + } return; } -- GitLab