From: Richard Zhu Date: Mon, 25 Mar 2019 09:22:00 +0000 (+0800) Subject: MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode X-Git-Tag: rel_imx_4.19.35_1.1.0~688 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=c5d0b19f7caa17e231fbf5c9a6612c94c2825bfe;p=linux.git MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode Since, the partition reset irq would be triggered anytime. Do not read the status of the MU if master side is in suspend mode. Signed-off-by: Richard Zhu (cherry picked from commit 117dbcb1ce258587f8d162c0b3219f32d6de6fbc) --- diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c index 356f613d7f92..64fef618cc52 100644 --- a/drivers/rpmsg/imx_rpmsg.c +++ b/drivers/rpmsg/imx_rpmsg.c @@ -65,6 +65,7 @@ struct imx_rpmsg_vproc { enum imx_rpmsg_variants variant; int vdev_nums; int first_notify; + u32 none_suspend; #define MAX_VDEV_NUMS 8 struct imx_virdev *ivdev[MAX_VDEV_NUMS]; void __iomem *mu_base; @@ -513,7 +514,7 @@ static int imx_rpmsg_mu_init(struct imx_rpmsg_vproc *rpdev) void imx_rpmsg_restore(struct imx_rpmsg_vproc *rpdev) { int i; - u32 flags; + u32 flags = 0; int vdev_nums = rpdev->vdev_nums; for (i = 0; i < vdev_nums; i++) { @@ -523,7 +524,8 @@ void imx_rpmsg_restore(struct imx_rpmsg_vproc *rpdev) /* Make a double check that remote processor is ready or not */ for (i = 0; i < REMOTE_READY_WAIT_MAX_RETRIES; i++) { - flags = MU_ReadStatus(rpdev->mu_base); + if (rpdev->none_suspend) + flags = MU_ReadStatus(rpdev->mu_base); if (flags & REMOTE_IS_READY) break; usleep_range(100, 200); @@ -776,6 +778,7 @@ static int imx_rpmsg_noirq_suspend(struct device *dev) { struct imx_rpmsg_vproc *rpdev = dev_get_drvdata(dev); + rpdev->none_suspend = 0; if (rpdev->mu_clk) clk_disable_unprepare(rpdev->mu_clk); @@ -794,8 +797,10 @@ static int imx_rpmsg_noirq_resume(struct device *dev) return ret; } } + ret = imx_rpmsg_mu_init(rpdev); + rpdev->none_suspend = 1; - return imx_rpmsg_mu_init(rpdev); + return ret; } #endif