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>
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];
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);