-
Notifications
You must be signed in to change notification settings - Fork 140
Trace fixes #3166
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
Trace fixes #3166
Conversation
DMA trace has been stopped and released at this point, so a wake_up() is not needed anymore. Fixes: 2291b8c ("ASoC: SOF: force end-of-file for debugfs trace at suspend") Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Trace must be stopped when the DSP suspends to a D0 substate. Move the call to snd_sof_release_trace() so that it can be released for all D0 substates and add the call to re-init trace when resuming from a low-power D0 substate. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
4103ef8 to
e63a9a1
Compare
When the stream is cleared during the suspend trigger, the dma_data must be set to NULL and snd_hdac_ext_stream_release() must be called to release the link dev. Without this, some platforms run into issues with triggering the host DMA during system resume. Add the missing sequences to both hda_link_pcm_trigger() to handle all streams that get suspended and to hda_dsp_set_hw_params_upon_resume() to handle paused streams that are reset during system suspend. Also, because the dma_data is set to NULL during suspend, add the checks to ensure link_dev is not NULL during hw_params and hw_free to prevent NULL pointer dereferences. BugLink: thesofproject/sof#4779 Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
e63a9a1 to
1328342
Compare
kv2019i
left a comment
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.
Partial review, commenting on the first patch.
| sdev->dtrace_is_enabled = false; | ||
| sdev->dtrace_draining = true; | ||
| wake_up(&sdev->trace_sleep); | ||
| } |
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.
Hmm, how can you be sure the user-space thread is not in sof_wait_trace_avail() ? The release trace can be called when sof-logger is still running and waiting for traces.
| snd_soc_dai_get_dma_data(dai, substream); | ||
| struct snd_sof_dev *sdev = | ||
| snd_soc_component_get_drvdata(dai->component); | ||
| struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
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.
typo in commit: dma_sata in subject
This reverts commit 9fadef7. After multiple trials on a CometLake SoundWire device, this revert to bring the trace back to what it was seems to be the only solution, the suggested PR thesofproject/linux#3166 does not help on this SoundWire device. We had similar issues with SD offset timeouts and a similar revert with thesofproject#4578 at the end of July, there's something that we are missing on what the trace does and how it impacts the DMA handling. BugLink: thesofproject#4779 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
to be replaced with a better fix |
This reverts commit 9fadef7. After multiple trials on a CometLake SoundWire device, this revert to bring the trace back to what it was seems to be the only solution, the suggested PR thesofproject/linux#3166 does not help on this SoundWire device. We had similar issues with SD offset timeouts and a similar revert with #4578 at the end of July, there's something that we are missing on what the trace does and how it impacts the DMA handling. BugLink: #4779 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes thesofproject/sof#4558
But it should also fix thesofproject/sof#4779 and possibly even #3034
And if it does fix #3034, it is replacement for #3099