From 859ec31b3a7cfefab190ab0047dee6084ddf4ef2 Mon Sep 17 00:00:00 2001 From: Richard Zhu Date: Fri, 14 Sep 2018 16:29:58 +0800 Subject: MLK-19588-1 imx: rpmsg: use timeout for MU_SendMessage function - Add the timeout mu msg send api. - Use the timeout mu send message function to do the notification when multi-vdev is enabled on one channel. Signed-off-by: Richard Zhu --- drivers/rpmsg/imx_rpmsg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/rpmsg') diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c index 7b6e772393fe..4fed5b07f2bc 100644 --- a/drivers/rpmsg/imx_rpmsg.c +++ b/drivers/rpmsg/imx_rpmsg.c @@ -121,8 +121,13 @@ static bool imx_rpmsg_notify(struct virtqueue *vq) mu_rpmsg = rpvq->vq_id << 16; mutex_lock(&rpvq->rpdev->lock); - /* send the index of the triggered virtqueue as the mu payload */ - MU_SendMessage(rpvq->rpdev->mu_base, 1, mu_rpmsg); + /* + * Send the index of the triggered virtqueue as the mu payload. + * Use the timeout MU send message here. + * Since that M4 core may not be loaded, and the first MSG may + * not be handled by M4 when multi-vdev is enabled. + */ + MU_SendMessageTimeout(rpvq->rpdev->mu_base, 1, mu_rpmsg, 200); mutex_unlock(&rpvq->rpdev->lock); return true; -- cgit v1.2.3