All of lore.kernel.org
 help / color / mirror / Atom feed
From: cezary.rojewski@intel.com
To: alsa-devel@alsa-project.org
Cc: pierre-louis.bossart@linux.intel.com,
	"Cezary Rojewski" <cezary.rojewski@intel.com>,
	lgirdwood@gmail.com, tiwai@suse.com, broonie@kernel.org,
	"Amadeusz Sławiński" <amadeuszx.slawinski@intel.com>
Subject: [PATCH 6/7] ASoC: Intel: Skylake: Reset pipeline before its deletion
Date: Thu, 13 Jun 2019 21:04:35 +0200	[thread overview]
Message-ID: <20190613190436.20156-7-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20190613190436.20156-1-cezary.rojewski@intel.com>

From: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>

Before actual deletion, pipeline should enter RESET state. Currently,
pipe skips this checkpoint and goes straight to the finish line.
This is not the expected path by the FW, so correct it.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/skylake/skl-messages.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index df01dc952521..79baf90e6116 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -1265,10 +1265,10 @@ int skl_create_pipeline(struct skl_sst *ctx, struct skl_pipe *pipe)
 }
 
 /*
- * A pipeline needs to be deleted on cleanup. If a pipeline is running, then
- * pause the pipeline first and then delete it
- * The pipe delete is done by sending delete pipeline IPC. DSP will stop the
- * DMA engines and releases resources
+ * A pipeline needs to be deleted on cleanup. If a pipeline is running,
+ * then pause it first. Before actual deletion, pipeline should enter
+ * reset state. Finish the procedure by sending delete pipeline IPC.
+ * DSP will stop the DMA engines and release resources
  */
 int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
 {
@@ -1276,6 +1276,10 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
 
 	dev_dbg(ctx->dev, "%s: pipe = %d\n", __func__, pipe->ppl_id);
 
+	/* If pipe was not created in FW, do not try to delete it */
+	if (pipe->state < SKL_PIPE_CREATED)
+		return 0;
+
 	/* If pipe is started, do stop the pipe in FW. */
 	if (pipe->state >= SKL_PIPE_STARTED) {
 		ret = skl_set_pipe_state(ctx, pipe, PPL_PAUSED);
@@ -1287,9 +1291,14 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
 		pipe->state = SKL_PIPE_PAUSED;
 	}
 
-	/* If pipe was not created in FW, do not try to delete it */
-	if (pipe->state < SKL_PIPE_CREATED)
-		return 0;
+	/* reset pipe state before deletion */
+	ret = skl_set_pipe_state(ctx, pipe, PPL_RESET);
+	if (ret < 0) {
+		dev_err(ctx->dev, "Failed to reset pipe ret=%d\n", ret);
+		return ret;
+	}
+
+	pipe->state = SKL_PIPE_RESET;
 
 	ret = skl_ipc_delete_pipeline(&ctx->ipc, pipe->ppl_id);
 	if (ret < 0) {
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-06-13 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 19:04 [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments cezary.rojewski
2019-06-13 19:04 ` [PATCH 1/7] ASoC: Intel: Skylake: Fix incorrect capture position reporting cezary.rojewski
2019-06-13 19:04 ` [PATCH 2/7] ASoC: Intel: Skylake: Use recommended SDxFMT programming sequence cezary.rojewski
2019-06-13 19:04 ` [PATCH 3/7] ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 4/7] ASoC: Intel: Fix race condition in IPC rx list cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Fix race condition in IPC rx list" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 5/7] ASoC: Intel: Common: Fix NULL dereference in tx_wait_done cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Common: Fix NULL dereference in tx_wait_done" to the asoc tree Mark Brown
2019-06-13 19:04 ` cezary.rojewski [this message]
2019-06-13 19:04 ` [PATCH 7/7] ASoC: Intel: Skylake: Strip T and L from TLV IPCs cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Strip T and L from TLV IPCs" to the asoc tree Mark Brown
2019-06-25 10:53 ` [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments Mark Brown
2019-06-25 13:10   ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613190436.20156-7-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@intel.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.