From dda8044183ff73ffb01fe2100fd524e6c62806df Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 12 Nov 2014 13:37:34 +0100 Subject: [PATCH] nova: refine the timer delay heuristic Fixes #1291 --- repos/os/src/drivers/timer/nova/platform_timer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repos/os/src/drivers/timer/nova/platform_timer.h b/repos/os/src/drivers/timer/nova/platform_timer.h index 2340edd4b..1fac7fff6 100644 --- a/repos/os/src/drivers/timer/nova/platform_timer.h +++ b/repos/os/src/drivers/timer/nova/platform_timer.h @@ -101,6 +101,7 @@ class Platform_timer /* XXX quirk start - description below */ static unsigned short quirk_count = 0; + static unsigned int delay = 0; Trace::Timestamp before = Trace::timestamp(); asm volatile ("":::"memory"); /* XXX quirk end */ @@ -143,11 +144,14 @@ class Platform_timer if (diff) quirk_count++; - else + else { quirk_count = 0; + delay = 0; + } if (quirk_count > 10) { - us_64 += 30000; + delay += 10000; + us_64 += delay; PWRN("apply timer quirk - diff=%lu, delay timeout %lu->%llu us", diff, _timeout, us_64); quirk_count = 0;