Commit 80d992ea authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/tick: dovetail: improve accuracy of the host tick delay

Expiration dates of in-band timers are based on the monotonic time
base read by ktime_get(), which is ok for us to use from non-NMI
context.

At this chance, drop the pointless 'inline' specifier from
pipeline_must_force_program_tick().
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 93c5c767
......@@ -55,19 +55,21 @@ void pipeline_set_timer_shot(unsigned long delay) /* ns */
}
static int proxy_set_next_ktime(ktime_t expires,
struct clock_event_device *proxy_dev)
struct clock_event_device *proxy_dev) /* hard irqs on/off */
{
struct xnsched *sched;
ktime_t delta;
unsigned long flags;
ktime_t delta;
int ret;
/*
* When Negative delta have been observed, we set delta zero.
* Or else exntimer_start() will return -ETIMEDOUT and do not
* trigger shot
* Expiration dates of in-band timers are based on the common
* monotonic time base. If the timeout date has already
* elapsed, make sure xntimer_start() does not fail with
* -ETIMEDOUT but programs the hardware for ticking
* immediately instead.
*/
delta = ktime_sub(expires, ktime_get_mono_fast_ns());
delta = ktime_sub(expires, ktime_get());
if (delta < 0)
delta = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment