MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode
authorRichard Zhu <hongxing.zhu@nxp.com>
Mon, 25 Mar 2019 09:22:00 +0000 (17:22 +0800)
committerRichard Zhu <hongxing.zhu@nxp.com>
Tue, 23 Apr 2019 02:48:08 +0000 (10:48 +0800)
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

index 356f613..64fef61 100644 (file)
@@ -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