* [PATCH] ASoC: SOF: Intel: Add error handling in hda_dsp_trace_release
@ 2023-09-23 9:12 liuhaoran
2023-10-03 15:13 ` Pierre-Louis Bossart
0 siblings, 1 reply; 2+ messages in thread
From: liuhaoran @ 2023-09-23 9:12 UTC (permalink / raw)
To: perex; +Cc: tiwai, alsa-devel, sound-open-firmware, liuhaoran
This patch adds error-handling for the hda_dsp_stream_put() inside
the hda_dsp_trace_release function in the hda-trace.c file.
Signed-off-by: liuhaoran <liuhaoran14@163.com>
---
sound/soc/sof/intel/hda-trace.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/intel/hda-trace.c b/sound/soc/sof/intel/hda-trace.c
index cbb9bd7770e6..5dcd43b9cbe4 100644
--- a/sound/soc/sof/intel/hda-trace.c
+++ b/sound/soc/sof/intel/hda-trace.c
@@ -73,13 +73,22 @@ int hda_dsp_trace_release(struct snd_sof_dev *sdev)
{
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct hdac_stream *hstream;
+ int ret;
if (hda->dtrace_stream) {
hstream = &hda->dtrace_stream->hstream;
- hda_dsp_stream_put(sdev,
+ ret = hda_dsp_stream_put(sdev,
SNDRV_PCM_STREAM_CAPTURE,
hstream->stream_tag);
+
hda->dtrace_stream = NULL;
+
+ if (ret < 0) {
+ dev_dbg(sdev->dev,
+ "stream put failed: %d\n", ret);
+ return ret;
+ }
+
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: SOF: Intel: Add error handling in hda_dsp_trace_release
2023-09-23 9:12 [PATCH] ASoC: SOF: Intel: Add error handling in hda_dsp_trace_release liuhaoran
@ 2023-10-03 15:13 ` Pierre-Louis Bossart
0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2023-10-03 15:13 UTC (permalink / raw)
To: liuhaoran, perex, Péter Ujfalusi
Cc: tiwai, alsa-devel, sound-open-firmware
On 9/23/23 05:12, liuhaoran wrote:
> This patch adds error-handling for the hda_dsp_stream_put() inside
> the hda_dsp_trace_release function in the hda-trace.c file.
>
> Signed-off-by: liuhaoran <liuhaoran14@163.com>
> ---
> sound/soc/sof/intel/hda-trace.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sof/intel/hda-trace.c b/sound/soc/sof/intel/hda-trace.c
> index cbb9bd7770e6..5dcd43b9cbe4 100644
> --- a/sound/soc/sof/intel/hda-trace.c
> +++ b/sound/soc/sof/intel/hda-trace.c
> @@ -73,13 +73,22 @@ int hda_dsp_trace_release(struct snd_sof_dev *sdev)
> {
> struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
> struct hdac_stream *hstream;
> + int ret;
>
> if (hda->dtrace_stream) {
> hstream = &hda->dtrace_stream->hstream;
> - hda_dsp_stream_put(sdev,
> + ret = hda_dsp_stream_put(sdev,
> SNDRV_PCM_STREAM_CAPTURE,
> hstream->stream_tag);
> +
> hda->dtrace_stream = NULL;
> +
> + if (ret < 0) {
> + dev_dbg(sdev->dev,
> + "stream put failed: %d\n", ret);
> + return ret;
> + }
> +
I don't know if returning an error helps here, this might get in the way
of the suspend.
Peter, what do you think?
> return 0;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-03 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-23 9:12 [PATCH] ASoC: SOF: Intel: Add error handling in hda_dsp_trace_release liuhaoran
2023-10-03 15:13 ` Pierre-Louis Bossart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).