clear-pkgs-linux-iot-lts2018/0437-ASoC-Intel-Skylake-pip...

69 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?=
<amadeuszx.slawinski@intel.com>
Date: Thu, 12 Jul 2018 12:55:26 +0200
Subject: [PATCH] ASoC: Intel: Skylake: pipeline needs to be reset before
disconnect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I5666ca1fca1ca80e9b431138470f4d9693ff011b
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>
Reviewed-on:
Reviewed-by: Bozek, DominikX <dominikx.bozek@intel.com>
Reviewed-by: Lewandowski, Gustaw <gustaw.lewandowski@intel.com>
Reviewed-by: Rojewski, Cezary <cezary.rojewski@intel.com>
Tested-by: Rojewski, Cezary <cezary.rojewski@intel.com>
---
sound/soc/intel/skylake/skl-messages.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index bc8d3afcf7d1..c01875a2a61d 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -2632,7 +2632,9 @@ 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
+ * pause the pipeline first and then delete it. There is also case in which
+ * pipeline needs to be reset before deletion, so always reset as it doesn't
+ * change anything in other cases.
* The pipe delete is done by sending delete pipeline IPC. DSP will stop the
* DMA engines and releases resources
*/
@@ -2642,6 +2644,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);
@@ -2653,9 +2659,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) {
--
https://clearlinux.org