From 61aef1bd23a9b07d1ce7d0ce5283feff6ed422e2 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Wed, 14 Nov 2018 13:33:05 +0800 Subject: [PATCH 1/2] ASoC: SOF: trace: fix a put stream failed issue We clear hstream->opened in hda_dsp_stream_put_cstream(), the redundant clear before that is leading to *_put_cstream() fail and error like 'tag 1 not opened!' reported. Here remove this extra clear to fix the issue. Signed-off-by: Keyon Jie --- sound/soc/sof/intel/hda-trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/sof/intel/hda-trace.c b/sound/soc/sof/intel/hda-trace.c index 3d36db3b1aa22e..8e01fb3677810c 100644 --- a/sound/soc/sof/intel/hda-trace.c +++ b/sound/soc/sof/intel/hda-trace.c @@ -76,7 +76,6 @@ int hda_dsp_trace_release(struct snd_sof_dev *sdev) if (sdev->hda->dtrace_stream) { hstream = &sdev->hda->dtrace_stream->hstream; - hstream->opened = false; hda_dsp_stream_put(sdev, SNDRV_PCM_STREAM_CAPTURE, hstream->stream_tag); From 25041a8c56bb530a3eb56572ce4a847793a39b22 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Wed, 7 Nov 2018 15:00:35 +0800 Subject: [PATCH 2/2] ASoC: SOF: trace: only init wait_queue one time Today we init trace wait_queue at each resume, snd_sof_init_trace_ipc(), which will clear the wait_queue entry that is waiting for trace update at suspend, that will lead to sof-logger infinitely waiting for logger tools like sof-logger so no trace updating or refreshing though we are back to resume and playback. Here move this wait_queue initialization to snd_sof_init_trace() which is called at first boot only, keep waiting trace update during S0->S3->S0, and fix logger tools no update issues. Signed-off-by: Keyon Jie --- sound/soc/sof/trace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c index 5db0aaca3bf0fb..0769f44db2a803 100644 --- a/sound/soc/sof/trace.c +++ b/sound/soc/sof/trace.c @@ -160,7 +160,6 @@ int snd_sof_init_trace_ipc(struct snd_sof_dev *sdev) params.buffer.offset = 0; params.buffer.pages = sdev->dma_trace_pages; - init_waitqueue_head(&sdev->trace_sleep); sdev->host_offset = 0; ret = snd_sof_dma_trace_init(sdev, ¶ms.stream_tag); @@ -233,6 +232,8 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev) goto table_err; } + init_waitqueue_head(&sdev->trace_sleep); + ret = snd_sof_init_trace_ipc(sdev); if (ret < 0) goto table_err;