diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2017-02-17 10:09:31 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:52:50 +0800 |
commit | c5ffd857b55b9ae46ca0cbd7e0dbd85a3a2733b4 (patch) | |
tree | 9c4093fb19e28fb29697b6321578288830711ab5 /sound | |
parent | aa0cc6695a1be86576ed678e577e13f03a60d269 (diff) |
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 <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_rpmsg_i2s.c | 1 | ||||
-rw-r--r-- | sound/soc/fsl/imx-pcm-rpmsg.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_rpmsg_i2s.c b/sound/soc/fsl/fsl_rpmsg_i2s.c index 172c279c7f94..d8f8da8dbf23 100644 --- a/sound/soc/fsl/fsl_rpmsg_i2s.c +++ b/sound/soc/fsl/fsl_rpmsg_i2s.c @@ -196,6 +196,7 @@ static int fsl_rpmsg_i2s_suspend(struct device *dev) struct i2s_rpmsg_s *rpmsg_tx; struct i2s_rpmsg_s *rpmsg_rx; + flush_workqueue(i2s_info->rpmsg_wq); rpmsg_tx = &i2s_info->send_msg[SNDRV_PCM_STREAM_PLAYBACK]; rpmsg_rx = &i2s_info->send_msg[SNDRV_PCM_STREAM_CAPTURE]; 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); |