diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c index 5080d11ca3033653a661ebdd56c88618a00ef306..85989799fe312e6249bf6c150fc4a74e32011f96 100644 --- a/sound/soc/fsl/fsl_dsp.c +++ b/sound/soc/fsl/fsl_dsp.c @@ -369,6 +369,7 @@ int fsl_dsp_open_func(struct fsl_dsp *dsp_priv, struct xf_client *client) atomic_set(&client->vm_use, 0); client->global = (void *)dsp_priv; + dsp_priv->proxy.is_loaded = 0; pm_runtime_get_sync(dev); @@ -688,10 +689,12 @@ static void dsp_load_firmware(const struct firmware *fw, void *context) (!strcmp(&strtab[shdr->sh_name], ".data")) || (!strcmp(&strtab[shdr->sh_name], ".bss")) ) { - memcpy_dsp((void *)(dsp_priv->sdram_vir_addr - + (sh_addr - dsp_priv->sdram_phys_addr)), - (const void *)image, - shdr->sh_size); + if (!dsp_priv->proxy.is_loaded) { + memcpy_dsp((void *)(dsp_priv->sdram_vir_addr + + (sh_addr - dsp_priv->sdram_phys_addr)), + (const void *)image, + shdr->sh_size); + } } else { memcpy_dsp((void *)(dsp_priv->regs + (sh_addr - dsp_priv->paddr)), @@ -704,6 +707,7 @@ static void dsp_load_firmware(const struct firmware *fw, void *context) /* start the core */ sc_pm_cpu_start(dsp_priv->dsp_ipcHandle, SC_R_DSP, true, dsp_priv->iram); + dsp_priv->proxy.is_loaded = 1; } /* Initialization of the MU code. */ diff --git a/sound/soc/fsl/fsl_dsp_proxy.h b/sound/soc/fsl/fsl_dsp_proxy.h index 3f2caeefaa5102be5cc9d7b65446c161e1a23e80..440cafb9bd16e66bb1ad96d515b48000baba2c15 100644 --- a/sound/soc/fsl/fsl_dsp_proxy.h +++ b/sound/soc/fsl/fsl_dsp_proxy.h @@ -299,6 +299,7 @@ struct xf_proxy { struct completion cmd_complete; int is_ready; + int is_loaded; /* ...internal lock */ spinlock_t lock;