From: "Dharageswari.R" dharageswari.r@intel.com
If request firmware fails at init, the code loader DMA allocation can be NULL, so check for boot complete before freeing up these resources
Signed-off-by: Dharageswari R dharageswari.r@intel.com Signed-off-by: Jeeja KP jeeja.kp@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/intel/skylake/skl-sst-dsp.c | 2 -- sound/soc/intel/skylake/skl-sst.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c index 2962ef22fc84..13c19855ee1a 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.c +++ b/sound/soc/intel/skylake/skl-sst-dsp.c @@ -336,8 +336,6 @@ void skl_dsp_free(struct sst_dsp *dsp) skl_ipc_int_disable(dsp);
free_irq(dsp->irq, dsp); - dsp->cl_dev.ops.cl_cleanup_controller(dsp); - skl_cldma_int_disable(dsp); skl_ipc_op_int_disable(dsp); skl_ipc_int_disable(dsp);
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index df7964fd09c3..db3a45ee102b 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -463,6 +463,10 @@ void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx) skl_clear_module_table(ctx->dsp); skl_ipc_free(&ctx->ipc); ctx->dsp->ops->free(ctx->dsp); + if (ctx->boot_complete) { + ctx->dsp->cl_dev.ops.cl_cleanup_controller(ctx->dsp); + skl_cldma_int_disable(ctx->dsp); + } } EXPORT_SYMBOL_GPL(skl_sst_dsp_cleanup);