nova: refine the timer delay heuristic

Fixes #1291
This commit is contained in:
Christian Prochaska 2014-11-12 13:37:34 +01:00 committed by Christian Helmuth
parent 3babee4e19
commit dda8044183
1 changed files with 6 additions and 2 deletions

View File

@ -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;