From 074b89e4a2c50ccffa1a324c23c6626a7c8e7d1c Mon Sep 17 00:00:00 2001 From: Richard Zhu <hongxing.zhu@nxp.com> Date: Mon, 25 Mar 2019 17:22:00 +0800 Subject: [PATCH] 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 <hongxing.zhu@nxp.com> (cherry picked from commit 117dbcb1ce258587f8d162c0b3219f32d6de6fbc) --- drivers/rpmsg/imx_rpmsg.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c index 8d2f2dde40eba..4e557d59b438e 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 -- GitLab