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

ASoC: SOF: ipc4-topology: Update the basecfg for copier earlier #4508

Conversation

ujfalusi
Copy link
Collaborator

@ujfalusi ujfalusi commented Aug 7, 2023

The sof_ipc4_update_resource_usage() call updates the CPC value in basecfg and it must be done prior to making a copy of the copier configuration for the init message.
Other module types do the resource update as last step or in case of a process module at the correct time, before the memcpy.

Fixes: d8a2c98 ("ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest")

The sof_ipc4_update_resource_usage() call updates the CPC value in basecfg
and it must be done prior to making a copy of the copier configuration
for the init message.
Other module types do the resource update as last step or in case of a
process module at the correct time, before the memcpy.

Fixes: d8a2c98 ("ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest")
Signed-off-by: Peter Ujfalusi <[email protected]>
@@ -1766,9 +1769,6 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
gtw_cfg_config_length,
&ipc4_copier->dma_config_tlv, dma_config_tlv_size);

/* update pipeline memory usage */
sof_ipc4_update_resource_usage(sdev, swidget, &copier_data->base_config);

Copy link
Member

Choose a reason for hiding this comment

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

is this saying that in practice the base firmware only received CPC values of zero so far?

Not fully clear on which bug this fixes, but it's Monday morning huh.

Copy link
Member

Choose a reason for hiding this comment

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

This fixes fresh unreported issue where driver could send 0 CPC even if proper data found in manifest for copier.

Copy link
Collaborator Author

@ujfalusi ujfalusi Aug 8, 2023

Choose a reason for hiding this comment

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

@plbossart, the firmware was receiving the previously found CPC value for the copier instance:

  1. We find X as a matching CPC but CPC of 0 is sent
  2. We find Y as a matching CPC but CPC of X is sent
  3. We did not find matching CPC (so it should be 0) but CPC of Y is sent

This is only affecting the copier because the sof_ipc4_update_pipeline_mem_usage() was after the memcpy and I only did a rename in patch 3f1e22f
In other places it was either before the memcpy or there were no memcpy at all.

@greg-intel
Copy link

This job is currently running, and may or may not finish successfully. (Approximately 2hr from now)

@greg-intel
Copy link

SOFCI TEST

@ujfalusi
Copy link
Collaborator Author

ujfalusi commented Aug 8, 2023

SOFCI TEST

@ujfalusi ujfalusi merged commit 78ed121 into thesofproject:topic/sof-dev Aug 8, 2023
9 checks passed
@ujfalusi ujfalusi deleted the peter/sof/pr/ipc4_topology_copier_cpc_fix_01 branch November 30, 2023 06:51
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