From 9b6a943e346e3ad83fff8a5ea7807a1358186907 Mon Sep 17 00:00:00 2001 From: Bartosz Kokoszko Date: Fri, 29 Jan 2021 18:09:48 +0100 Subject: [PATCH] timer_domain: set last_tick to ticks_req in order to avoid drift In the case of scheduling irregularities the drift may accumulate in the scheduling reference value. By ensuring we always refer to the previous requested time the drift can be prevented. Signed-off-by: Bartosz Kokoszko Signed-off-by: Slawomir Blauciak --- src/schedule/timer_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schedule/timer_domain.c b/src/schedule/timer_domain.c index b42cb0c4cf26..6cf0b3524d3f 100644 --- a/src/schedule/timer_domain.c +++ b/src/schedule/timer_domain.c @@ -283,7 +283,7 @@ static void timer_domain_set(struct ll_schedule_domain *domain, uint64_t start) timer_report_delay(timer_domain->timer->id, ticks_set - ticks_req); - domain->last_tick = ticks_set; + domain->last_tick = ticks_req; platform_shared_commit(timer_domain, sizeof(*timer_domain)); }