Skip to content
Snippets Groups Projects
Commit 27c40185 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Federico Vaga
Browse files

triggers: soft timestamp is in zio_arm_trigger()


Soft timestamping happens at zio_arm_trigger time. This removes
the various software timestamping in the individual trigger.
Moreover, arming is idempotent, so timestamp in the locked section,
only when the trigger is actually armed.

As usual, hardware can overwrite ti timestamps, so this software stamp
is only used for devices that have no better notion of time.

Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
parent 0994f8c7
Branches
Tags
No related merge requests found
......@@ -132,6 +132,7 @@ void zio_arm_trigger(struct zio_ti *ti)
return;
}
ti->flags |= ZIO_TI_ARMED;
getnstimeofday(&ti->tstamp);
spin_unlock_irqrestore(&ti->cset->lock, flags);
if (likely((ti->flags & ZIO_DIR) == ZIO_DIR_INPUT))
......
......@@ -144,9 +144,6 @@ static enum hrtimer_restart ztt_fn(struct hrtimer *timer)
ztt = container_of(timer, struct ztt_instance, timer);
ti = &ztt->ti;
/* When this sw-trigger fires, we must fill the timestamp */
getnstimeofday(&ti->tstamp);
/* FIXME: fill the trigger attributes too */
ztt = to_ztt_instance(ti);
......
......@@ -54,8 +54,6 @@ static irqreturn_t zti_handler(int irq, void *dev_id)
{
struct zio_ti *ti = dev_id;
/* When a trigger fires, we must prepare our control and timestamp */
getnstimeofday(&ti->tstamp);
zio_arm_trigger(ti);
return IRQ_HANDLED;
}
......
......@@ -117,12 +117,9 @@ static void ztt_fn(unsigned long arg)
struct zio_ti *ti = (void *)arg;
struct ztt_instance *ztt;
/* When this sw-trigger fires, we must fill the timestamp */
getnstimeofday(&ti->tstamp);
ztt = to_ztt_instance(ti);
zio_arm_trigger(ti);
ztt = to_ztt_instance(ti);
if (!ztt->period)
return; /* one-shot */
......
......@@ -51,7 +51,6 @@ static int ztu_push_block(struct zio_ti *ti, struct zio_channel *chan,
chan_for_each(chan, cset)
if (!chan->active_block)
return 0;
getnstimeofday(&ti->tstamp);
zio_arm_trigger(ti);
return 0;
}
......@@ -65,7 +64,6 @@ static void ztu_pull_block(struct zio_ti *ti, struct zio_channel *chan)
if (zio_cset_early_arm(ti->cset))
return;
/* Otherwise, the user sets the input timing by reading */
getnstimeofday(&ti->tstamp);
zio_arm_trigger(ti);
}
......
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