Commit 02923faa authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Mark Brown

ASoC: Intel: Skylake: Reset pipeline before its deletion

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: default avatarAmadeusz Sławiński <amadeuszx.slawinski@intel.com>
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9f4f42d7
...@@ -1265,10 +1265,10 @@ int skl_create_pipeline(struct skl_sst *ctx, struct skl_pipe *pipe) ...@@ -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 * A pipeline needs to be deleted on cleanup. If a pipeline is running,
* pause the pipeline first and then delete it * then pause it first. Before actual deletion, pipeline should enter
* The pipe delete is done by sending delete pipeline IPC. DSP will stop the * reset state. Finish the procedure by sending delete pipeline IPC.
* DMA engines and releases resources * DSP will stop the DMA engines and release resources
*/ */
int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe) 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) ...@@ -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); 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 is started, do stop the pipe in FW. */
if (pipe->state >= SKL_PIPE_STARTED) { if (pipe->state >= SKL_PIPE_STARTED) {
ret = skl_set_pipe_state(ctx, pipe, PPL_PAUSED); 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) ...@@ -1287,9 +1291,14 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
pipe->state = SKL_PIPE_PAUSED; pipe->state = SKL_PIPE_PAUSED;
} }
/* If pipe was not created in FW, do not try to delete it */ /* reset pipe state before deletion */
if (pipe->state < SKL_PIPE_CREATED) ret = skl_set_pipe_state(ctx, pipe, PPL_RESET);
return 0; 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); ret = skl_ipc_delete_pipeline(&ctx->ipc, pipe->ppl_id);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment