diff options
-rw-r--r-- | sound/soc/fsl/fsl_dsp.c | 1 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dsp_platform_compress.c | 8 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dsp_proxy.c | 5 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dsp_proxy.h | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c index c849f0832b3d..629947f65ca8 100644 --- a/sound/soc/fsl/fsl_dsp.c +++ b/sound/soc/fsl/fsl_dsp.c @@ -370,6 +370,7 @@ int fsl_dsp_open_func(struct fsl_dsp *dsp_priv, struct xf_client *client) client->global = (void *)dsp_priv; dsp_priv->proxy.is_loaded = 0; + dsp_priv->proxy.is_active = 1; pm_runtime_get_sync(dev); diff --git a/sound/soc/fsl/fsl_dsp_platform_compress.c b/sound/soc/fsl/fsl_dsp_platform_compress.c index 6f0d5515c740..42c80ee8ccb8 100644 --- a/sound/soc/fsl/fsl_dsp_platform_compress.c +++ b/sound/soc/fsl/fsl_dsp_platform_compress.c @@ -28,9 +28,9 @@ void dsp_platform_process(struct work_struct *w) while (1) { rmsg = xf_cmd_recv(proxy, &client->wait, &client->queue, 1); - if (IS_ERR(rmsg)) { + + if (!proxy->is_active || IS_ERR(rmsg)) return; - } if (rmsg->opcode == XF_EMPTY_THIS_BUFFER) { client->consume_bytes += rmsg->length; snd_compr_fragment_elapsed(client->cstream); @@ -101,7 +101,9 @@ static int dsp_platform_compr_free(struct snd_compr_stream *cstream) cpu_dai->driver->ops->shutdown(NULL, cpu_dai); - ret = cancel_work(&drv->client->work); + drv->client->proxy->is_active = 0; + wake_up(&drv->client->wait); + cancel_work_sync(&drv->client->work); fsl_dsp_close_func(drv->client); diff --git a/sound/soc/fsl/fsl_dsp_proxy.c b/sound/soc/fsl/fsl_dsp_proxy.c index 1f4390487c78..94bffc06c608 100644 --- a/sound/soc/fsl/fsl_dsp_proxy.c +++ b/sound/soc/fsl/fsl_dsp_proxy.c @@ -557,12 +557,13 @@ struct xf_message *xf_cmd_recv(struct xf_proxy *proxy, struct xf_msg_queue *queue, int wait) { - struct xf_message *m; + struct xf_message *m = NULL; int ret; /* ...wait for message reception (take lock on success) */ ret = wait_event_interruptible(*wq, - (m = xf_msg_received(proxy, queue)) != NULL || !wait); + (m = xf_msg_received(proxy, queue)) != NULL || !wait + || !proxy->is_active); if (ret) return ERR_PTR(-EINTR); diff --git a/sound/soc/fsl/fsl_dsp_proxy.h b/sound/soc/fsl/fsl_dsp_proxy.h index 8df703efea63..c80412a632ff 100644 --- a/sound/soc/fsl/fsl_dsp_proxy.h +++ b/sound/soc/fsl/fsl_dsp_proxy.h @@ -300,7 +300,7 @@ struct xf_proxy { struct completion cmd_complete; int is_ready; int is_loaded; - + int is_active; /* ...internal lock */ spinlock_t lock; |