Skip to content

[BUG] pipeline_comp_trigger() has a logic error #4746

Closed

Description

@lyakh

Describe the bug
pipeline_comp_trigger() effectively does this:

	err = comp_trigger(current, ppl_data->cmd);
	if (err < 0 || err == PPL_STATUS_PATH_STOP)
		return err;

	return pipeline_for_each_comp(current, ctx, dir);

and it is called from pipeline_trigger_run() as this:

	struct pipeline_walk_context walk_ctx = {
		.comp_func = pipeline_comp_trigger,
		.comp_data = &data,
		.skip_incomplete = true,
	};

	ret = walk_ctx.comp_func(host, NULL, &walk_ctx, host->direction);

	return ret;

Also note, that pipeline_for_each_comp() ignores non-negative return codes from the iterator function:

	int err = ctx->comp_func(buffer_comp, buffer,
				 ctx, dir);
	return 0;

This means, that if pipeline_comp_trigger() returns PPL_STATUS_PATH_STOP for the first component in the pipeline, i.e. when directly called from pipeline_trigger_run(), that return code will be propagated back to the caller. However, if that code is returned by one of later pipeline components, it will be ignored. This is probably not the intended behaviour. Note, that this code has been significantly altered by my recent commits, e.g. e8d2226 but this behaviour has been preserved and can be verified in the code base before that commit.

Activity

  1. added
    bugSomething isn't working as expected
    on Sep 10, 2021
  2. lgirdwood commented on Sep 10, 2021

    @lgirdwood
    Member

    @lyakh - not intended behavior - we should respect the result and STOP. Can you fix ?

  3. self-assigned this
    on Sep 10, 2021
  4. lyakh commented on Nov 16, 2021

    @lyakh
    CollaboratorAuthor

    fixed by #4868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions