From c5ffd857b55b9ae46ca0cbd7e0dbd85a3a2733b4 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Fri, 17 Feb 2017 10:09:31 +0800 Subject: MLK-13992: ASoC: fsl_rpmsg_i2s: add flush workqueue some cmd is sent by workqueue, others are sent by call send message function directly, for workqueue may have delay, so there is occasion that cmd is not sent in order. Add flush_workqueue before the CLOSE and SUSPEND to make sure previous cmd is finished in that time. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/imx-pcm-rpmsg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc/fsl/imx-pcm-rpmsg.c') diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index 25369cc0fade..ace3bd77c8c2 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -149,6 +149,8 @@ static int imx_rpmsg_pcm_close(struct snd_pcm_substream *substream) rpmsg->header.cmd = I2S_TX_CLOSE; else rpmsg->header.cmd = I2S_RX_CLOSE; + + flush_workqueue(i2s_info->rpmsg_wq); i2s_info->send_message(rpmsg, i2s_info); kfree(prtd); -- cgit v1.2.3