Repository navigation
ASoC: SOF: Intel: hda: clean up link DMA during stop for IPC4 #5197
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
Changes from all commits
e991415
c032ba3
62ad278
5db9c7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,11 +383,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream, | |
| static int intel_prepare(struct snd_pcm_substream *substream, | ||
| struct snd_soc_dai *dai) | ||
| { | ||
| struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The " after a call to snd_pcm_drain/snd_pcm_drop" is duplicated in commit message (second time "This is needed for the case that the DMA data is cleared when the PCM is stopped due to xruns or snd_pcm_drain/drop()." |
||
| struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai); | ||
| struct sdw_intel *sdw = cdns_to_intel(cdns); | ||
| struct sdw_cdns_dai_runtime *dai_runtime; | ||
| struct snd_pcm_hw_params *hw_params; | ||
| int ch, dir; | ||
| int ret = 0; | ||
|
|
||
| dai_runtime = cdns->dai_runtime_array[dai->id]; | ||
| if (!dai_runtime) { | ||
|
|
@@ -396,12 +397,8 @@ static int intel_prepare(struct snd_pcm_substream *substream, | |
| return -EIO; | ||
| } | ||
|
|
||
| hw_params = &rtd->dpcm[substream->stream].hw_params; | ||
| if (dai_runtime->suspended) { | ||
| struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); | ||
| struct snd_pcm_hw_params *hw_params; | ||
|
|
||
| hw_params = &rtd->dpcm[substream->stream].hw_params; | ||
|
|
||
| dai_runtime->suspended = false; | ||
|
|
||
| /* | ||
|
|
@@ -422,15 +419,11 @@ static int intel_prepare(struct snd_pcm_substream *substream, | |
| /* the SHIM will be configured in the callback functions */ | ||
|
|
||
| sdw_cdns_config_stream(cdns, ch, dir, dai_runtime->pdi); | ||
|
|
||
| /* Inform DSP about PDI stream number */ | ||
| ret = intel_params_stream(sdw, substream, dai, | ||
| hw_params, | ||
| sdw->instance, | ||
| dai_runtime->pdi->intel_alh_id); | ||
| } | ||
|
|
||
| return ret; | ||
| /* Inform DSP about PDI stream number */ | ||
| return intel_params_stream(sdw, substream, dai, hw_params, sdw->instance, | ||
| dai_runtime->pdi->intel_alh_id); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need the same change in drivers/soundwire/intel.c for the older platforms?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory this is only needed when HD-DMA is used on the link side, so ACE2+, but I'm not sure, I guess tests will tell if needed or not...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good assumption to capture in our inline comments.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not needed for platform up until MTL because we dont use the link DMA for Soundwire in those platforms. Thats why this is isolated to ACE2+ |
||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kv2019i Yes, we can have soundwire/asoc combined patches especially when they have dependency. Usually, it will be applied to the tree that the main change is in with the other maintainer's ack-by tag. |
||
|
|
||
| static int | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the commit is a bit hard to understand alone (and in drivers/soundwire this is potentially view as a standalone commit). Without "ASoC: SOF: Intel: hda: Always clean up link DMA during stop ", this patch has not been needed but there a audio corruption was hit (with Soundwire as well). So this commit is inherently linked to the 4th patch and at minimum the bug needs to be mentioned. I wonder if this could be combined as a single patch or at least a depends or some-such tag is need to ensure these two patches always go together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message is good now, but how about the series dependencies @ranj063 @ujfalusi @bardliao ? Should a "Depends-on: " tag be added between the SOF and soundwire patches, or just have a link to the bug in all. If a partial series is cherry-picked to a stable tree, the bugfix will not be complete.