Skip to content

comp: fix binding modules - #6773

Merged
mwasko merged 1 commit into
thesofproject:mainfrom
fkwasowi:prv-fkwasowi_fixed_binding_pipelines
Dec 15, 2022
Merged

mwasko merged 1 commit into
thesofproject:mainfrom
fkwasowi:prv-fkwasowi_fixed_binding_pipelines

Conversation

@fkwasowi

@fkwasowi fkwasowi commented Dec 12, 2022 •

Copy link
Copy Markdown
Contributor

Current ipc_comp_connect() connects the source first, then calls comp_bind
and only then connects the sink. This leads to errors with modules that
assume sink to be connected at bind. This is a valid assumption, so fix
the order in ipc_comp_connect().

@lgirdwood

Copy link
Copy Markdown
Member

@fkwasowi can you check internal CI thanks !

Comment thread src/ipc/ipc4/helper.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'd also need to fix the error paths below. e_sink_connect label no longer needs to do an unbind right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some whitespace error on L383 and L384, indentation seems off.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespaces fixed

@ranj063

ranj063 commented Dec 12, 2022 •

Copy link
Copy Markdown
Collaborator

Is there an issue filed so we can see when this problem occurs?

There is no issue created for this defect. The problem occurs, for example, during a test scenario \conv_fw_003_kd\test_01_kd_topologies

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good fix, but it would be helpful to explain why this has worked before and why the change is needed now. So maybe something like:

comp: fix module bind order

Current ipc_comp_connect() connects the source first, then calls comp_bind
and only then connects the sink. This leads to errors with modules that
assume sink to be connected at bind. This is a valid assumption, so fix
the order in ipc_comp_connect().

And some indentation issue in code. Maybe a github UI artifact, but please check.

Comment thread src/ipc/ipc4/helper.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some whitespace error on L383 and L384, indentation seems off.

@fkwasowi
fkwasowi force-pushed the prv-fkwasowi_fixed_binding_pipelines branch from c549d73 to d375a53 Compare December 13, 2022 09:45
@fkwasowi

Copy link
Copy Markdown
Contributor Author

Is there an issue filed so we can see when this problem occurs?

There is no issue created for this defect. The problem occurs, for example, during a test scenario \conv_fw_003_kd\test_01_kd_topologies

@fkwasowi

Copy link
Copy Markdown
Contributor Author

Looks like a good fix, but it would be helpful to explain why this has worked before and why the change is needed now. So maybe something like:

comp: fix module bind order

Current ipc_comp_connect() connects the source first, then calls comp_bind
and only then connects the sink. This leads to errors with modules that
assume sink to be connected at bind. This is a valid assumption, so fix
the order in ipc_comp_connect().

And some indentation issue in code. Maybe a github UI artifact, but please check.

I have changed the description

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fkwasowi ! I think the goto handling is still missing, that needs to be changed to reflect the new order.

Comment thread src/ipc/ipc4/helper.c Outdated

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some tuning in the error case, please see my inline comment.

Comment thread src/ipc/ipc4/helper.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And have "e_source_bind" here.

Comment thread src/ipc/ipc4/helper.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So actually, please keep this as "goto e_sink_connect;" and then
at end of function, have:

err:
	comp_unbind(sink, bu);
e_sink_bind:
	comp_unbind(source, bu);
e_src_bind:
	pipeline_disconnect(sink, buffer, PPL_CONN_DIR_BUFFER_TO_COMP);
e_sink_connect:
	pipeline_disconnect(source, buffer, PPL_CONN_DIR_COMP_TO_BUFFER);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.Is it now correct?

@fkwasowi
fkwasowi force-pushed the prv-fkwasowi_fixed_binding_pipelines branch from 85f4bf1 to 27fca6b Compare December 14, 2022 12:38

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fkwasowi , looks good now!

Current ipc_comp_connect() connects the source first, then calls comp_bind
and only then connects the sink. This leads to errors with modules that
assume sink to be connected at bind. This is a valid assumption, so fix
the order in ipc_comp_connect().

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
@fkwasowi
fkwasowi force-pushed the prv-fkwasowi_fixed_binding_pipelines branch from 27fca6b to 6da6515 Compare December 14, 2022 15:01
@fkwasowi

Copy link
Copy Markdown
Contributor Author

SOFCI TEST

@libinyang

Copy link
Copy Markdown
Contributor

Patch looks good to me. I have tested on WoV pipeline. This can fix #6784

@mwasko
mwasko merged commit 18dc72f into thesofproject:main Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants