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

bugfix: clear ZTI_BUSY flag when trigger is disabled


When disabling a trigger, ZIO invokes t_op->abort() to stop acquisition.
If the abort function invokes data_done() to return partial
blocks, the ZTI_BUSY flag is correctly cleared. But, if the abort
function frees all active blocks the flag remains set.

With this patch, always clear the ZTI_BUSY flag when the trigger is
disabled so it is correct if/when the trigger is re-enabled.

Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent f6581430
Branches
Tags
No related merge requests found
......@@ -70,7 +70,9 @@ void zio_fire_trigger(struct zio_ti *ti);
* trigger. For output, data_done frees the blocks and prepares new
* blocks if possible; for input, data_done pushes material to the buffers.
* If the transfer must be interrupted before the invocation of data_done,
* the abort function must be called.
* the abort function must be called. The abort function has two choice: it
* can invoke data_done and return partial blocks, or free all the active
* blocks.
*
* Then, a trigger instance is configured either by sysfs (and this means
* the conf_set callback runs and the instance is notified) or by writing
......
......@@ -770,9 +770,13 @@ static void __zobj_enable(struct kobject *kobj, unsigned int enable,
ti = to_zio_ti(kobj);
/* if trigger is running, abort it*/
if (*flags & ZTI_BUSY)
spin_lock(&ti->cset->lock);
if (*flags & ZTI_BUSY) {
if(ti->t_op->abort)
ti->t_op->abort(ti->cset);
*flags &= ~ZTI_BUSY; /* when disabled is not busy */
}
spin_unlock(&ti->cset->lock);
/* trigger instance callback */
if (ti->t_op->change_status) {
pr_debug("%s:%d\n", __func__, __LINE__);
......
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