Skip to contentSkip to conversation

fix regression around one-shot host tick

PATCH In review Jan Kiszka 2 participants 2 messages Jul 19, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 fix regression around one-shot host tick

Philippe,

this bug was introduced with recent clock_event modifications:

nucleus/timer.c +1 -2
@@ -245,7 +245,7 @@ void xntimer_tick_aperiodic(void)
 			   translates into precious microsecs on low-end hw. */
 			__setbits(sched->status, XNHTICK);
 			if (!testbits(timer->status, XNTIMER_PERIODIC))
-				goto out;
+				continue;
 		}
 
 		do {
@@ -254,7 +254,6 @@ void xntimer_tick_aperiodic(void)
 		xntimer_enqueue_aperiodic(timer);
 	}
 
-out:
 	__clrbits(sched->status, XNINTCK);
 
 	xntimer_next_local_shot(sched);

It doesn't look like typo, so what was your original intention? The current code at least fails to handle outstanding timers that are enqueued right behind a one-shot host-tick timer.

Jan

#1 lore raw
Quoted 25 lines · Jan Kiszka

Philippe,

this bug was introduced with recent clock_event modifications:

nucleus/timer.c +1 -2
@@ -245,7 +245,7 @@ void xntimer_tick_aperiodic(void)
 			   translates into precious microsecs on low-end hw. */
 			__setbits(sched->status, XNHTICK);
 			if (!testbits(timer->status, XNTIMER_PERIODIC))
-				goto out;
+				continue;
 		}
 
 		do {
@@ -254,7 +254,6 @@ void xntimer_tick_aperiodic(void)
 		xntimer_enqueue_aperiodic(timer);
 	}
 
-out:
 	__clrbits(sched->status, XNINTCK);
 
 	xntimer_next_local_shot(sched);
Quoted 1 line

It doesn't look like typo, so what was your original intention?

The host timer is no more a purely periodic beast. Since it may be aperiodic, we ought to get away from the interval update loop, otherwise we'd remain stuck into it in the aperiodic case.

Quoted 2 lines

The current code at least fails to handle outstanding timers that are enqueued right behind a one-shot host-tick timer.

True, I've been slightly, mmm, radical here. Will merge.

Quoted 2 lines

Jan

Signature · 1 line
Philippe.