Commit 05e6986d authored by Federico Vaga's avatar Federico Vaga Committed by Alessandro Rubini

zio-trig-hrt.c: change relative time from 1h to 10s

The in-kenrel hrt uses absolute times, and so does the zio trigger
based on it.  However, for testing in shell scripts, relative times
are easier to handle.  We accepted any "absolute" time less than 1 hour
to be considered relative, but then we realized some embedded systems
have no real-world time notion, so they start at Jan 1st 1970.

This decreases relative times to 10s, assuming it's enough for shell
scripts during testing and short enough to allow the rare embedded system
to be later than tat by the time zio runs.
Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent c602bbdb
......@@ -2708,8 +2708,9 @@ This release of ZIO includes the following trigger types:
@item hrt
High-resolution timer. This trigger can work as both periodic
and one-shot. It is configured for absolute times or for some
delay in the future (to ease testing with shell scripts). It accepts
and one-shot. It is configured for absolute times, but
``absolute'' times less than 10s are considered relative
(to ease testing with shell scripts). The trigger accepts
both scalar nanoseconds (as low-half and high-half values) and
seconds + nanoseconds. Another attribute specifies the allowed
slack to be used in programming the kernel resource.
......
......@@ -94,7 +94,7 @@ static int ztt_conf_set(struct device *dev, struct zio_attribute *zattr,
ztt->ts.tv_nsec = usr_val;
break;
case ZTT_ATTR_EXP_SEC:
if (usr_val < 3600) {
if (usr_val < 10) {
getnstimeofday(&now);
usr_val += now.tv_sec;
}
......
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