Skip to content
Snippets Groups Projects
Commit 3613decd authored by Alessandro Rubini's avatar Alessandro Rubini
Browse files

core: rename a simple function, fix re-arming triggers


zio_cset_is_self_timed() only returned true for input channels.  This
is needed, but the name is wrong: use zio_cset_early_arm() instead.

An output channel can be self-timed as well, so trigger_data_done
check the flag directly, not early_arm(). Every self-timed cset
must be rearmed when the trigger fired.

Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
parent abf04edb
Branches
Tags
No related merge requests found
......@@ -159,7 +159,8 @@ EXPORT_SYMBOL(zio_arm_trigger);
*/
void zio_trigger_data_done(struct zio_cset *cset)
{
int self_timed = zio_cset_is_self_timed(cset);
int self_timed = cset->flags & ZIO_CSET_SELF_TIMED;
unsigned long flags;
spin_lock_irqsave(&cset->lock, flags);
......
......@@ -212,7 +212,7 @@ enum zio_cset_flags {
};
/* Check the flags so we know whether to arm immediately or not */
static inline int zio_cset_is_self_timed(struct zio_cset *cset)
static inline int zio_cset_early_arm(struct zio_cset *cset)
{
unsigned long flags = cset->flags;
......
......@@ -331,7 +331,7 @@ int zio_change_current_trigger(struct zio_cset *cset, char *name)
spin_unlock_irqrestore(&cset->lock, flags);
/* Finally, arm it if so needed */
if (zio_cset_is_self_timed(cset))
if (zio_cset_early_arm(cset))
zio_arm_trigger(ti);
return 0;
......@@ -434,7 +434,7 @@ int zio_change_current_buffer(struct zio_cset *cset, char *name)
spin_unlock_irqrestore(&cset->lock, flags);
/* Finally, arm the trigger if so needed */
if (zio_cset_is_self_timed(cset))
if (zio_cset_early_arm(cset))
zio_arm_trigger(ti);
return 0;
......@@ -775,7 +775,7 @@ static int cset_register(struct zio_cset *cset, struct zio_cset *cset_t)
ti->flags &= ~ZIO_DISABLED;
spin_unlock_irqrestore(&cset->lock, flags);
if (zio_cset_is_self_timed(cset))
if (zio_cset_early_arm(cset))
zio_arm_trigger(ti);
return 0;
......
......@@ -56,7 +56,7 @@ static void ztu_pull_block(struct zio_ti *ti, struct zio_channel *chan)
pr_debug("%s:%d\n", __func__, __LINE__);
/* For self-timed devices, we have no pull, as it's already armed */
if (zio_cset_is_self_timed(ti->cset))
if (zio_cset_early_arm(ti->cset))
return;
/* Otherwise, the user sets the input timing by reading */
getnstimeofday(&ti->tstamp);
......
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