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: intel: hda: Clean up link DMA for IPC3 during stop #4484

Merged

Conversation

ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Jul 21, 2023

With IPC3, we reset hw_params during the stop trigger, so we should also clean up the link DMA during the stop trigger.

Fixes: 1bf83fa ("ASoC: SOF: Intel: hda-dai: Do not perform DMA cleanup during stop")

bardliao
bardliao previously approved these changes Jul 24, 2023
sound/soc/sof/intel/hda-loader.c Outdated Show resolved Hide resolved
Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

not following @ranj063

return ret;

if (cmd == SNDRV_PCM_TRIGGER_STOP)
return hda_link_dma_cleanup(substream, hext_stream, cpu_dai);
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand how this is compatible with the previous direction to keep the stream tag in 1bf83fa whose commit message included

"In the case of repeated start/stop without involving hw_free, the stream
tag needs to be preserved for the subsequent starts. So, skip performing
the DMA clean up during stop and handle it only during suspend or
hw_free.
"

??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@plbossart that commit was a mistake for IPC3. In the case of IPC3, the post_trigger op frees clears the DMA channel ID and send the DAI_CONFIG to clear the DMA iD in the firmware as well. So we must clean up the link DMA set up so that we can re-assign and do the DAI_CONFIG again during prepare in the case of repeasted hw_params without hw_free.

Copy link
Member

Choose a reason for hiding this comment

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

ah ok, the commit 1bf83fa was for IPC4, makes sense now. Thanks for the clarification.

@plbossart
Copy link
Member

plbossart commented Jul 24, 2023

Don't we need additional tags @ranj063

Closes: #4455
Closes: #4482

@plbossart plbossart requested review from lyakh and bardliao July 24, 2023 20:06
With IPC3, we reset hw_params during the stop trigger, so we should also
clean up the link DMA during the stop trigger.

Fixes: 1bf83fa ("ASoC: SOF: Intel: hda-dai: Do not perform DMA cleanup during stop")
Closes: thesofproject#4455
Closes: thesofproject#4482
Signed-off-by: Ranjani Sridharan <[email protected]>
@ranj063
Copy link
Collaborator Author

ranj063 commented Jul 24, 2023

Don't we need additional tags @ranj063

Closes: #4455 Closes: #4482

Don't we need additional tags @ranj063

Closes: #4455 Closes: #4482

update now. Thanks @plbossart

Copy link

@lyakh lyakh left a comment

Choose a reason for hiding this comment

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

I guess an alternative way to fix 1bf83fa would be by reverting it for IPC3 - by re-adding that line and surrounding it with #if CONFIG_... / #endif

@ranj063
Copy link
Collaborator Author

ranj063 commented Jul 25, 2023

I guess an alternative way to fix 1bf83fa would be by reverting it for IPC3 - by re-adding that line and surrounding it with #if CONFIG_... / #endif

@lyakh #if CONFIG_ wontwork because both IPC3 & IPC4 are always enabled by default

@plbossart plbossart merged commit 0617abc into thesofproject:topic/sof-dev Jul 25, 2023
9 checks passed
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.

6 participants