Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helper: add a condition before updating the component direction #8197

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/include/sof/ipc/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int ipc4_chain_dma_state(struct comp_dev *dev, struct ipc4_chain_dma *cdma);
int ipc4_create_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma);
int ipc4_trigger_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma, bool *delay);
int ipc4_process_on_core(uint32_t core, bool blocking);
int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id);
int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id, uint32_t cmd);
int ipc4_find_dma_config(struct ipc_config_dai *dai, uint8_t *data_buffer, uint32_t size);
int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd);
int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *delayed);
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
switch (status) {
case COMP_STATE_INIT:
tr_dbg(&ipc_tr, "pipeline %d: reset from init", ppl_icd->id);
ret = ipc4_pipeline_complete(ipc, ppl_icd->id);
ret = ipc4_pipeline_complete(ipc, ppl_icd->id, cmd);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@fkwasowi may I ask why we even need to invoke ipc4_pipeline_complete() during pipeline reset?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is still unanswered, but I assume this is a more complex. git blame shows this code has been here for a long, long time...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the answer to the question: 8541d68

if (ret < 0)
ret = IPC4_INVALID_REQUEST;

Expand All @@ -296,7 +296,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
switch (status) {
case COMP_STATE_INIT:
tr_dbg(&ipc_tr, "pipeline %d: pause from init", ppl_icd->id);
ret = ipc4_pipeline_complete(ipc, ppl_icd->id);
ret = ipc4_pipeline_complete(ipc, ppl_icd->id, cmd);
if (ret < 0)
ret = IPC4_INVALID_REQUEST;

Expand Down
10 changes: 6 additions & 4 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int ipc4_update_comps_direction(struct ipc *ipc, uint32_t ppl_id)
return 0;
}

int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id, uint32_t cmd)
{
struct ipc_comp_dev *ipc_pipe;
int ret;
Expand All @@ -649,9 +649,11 @@ int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
* pipeline w/o connection to gateway, so direction is not configured in binding phase.
* Need to update direction for such modules when pipeline is completed.
*/
ret = ipc4_update_comps_direction(ipc, comp_id);
if (ret < 0)
return ret;
if (cmd != SOF_IPC4_PIPELINE_STATE_RESET) {
ret = ipc4_update_comps_direction(ipc, comp_id);
if (ret < 0)
return ret;
}

return ipc_pipeline_complete(ipc, comp_id);
}
Expand Down
Loading