lkml.org 
[lkml]   [2022]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.17 1036/1126] mailbox: imx: fix wakeup failure from freeze mode
    Date
    From: Robin Gong <yibin.gong@nxp.com>

    commit 892cb524ae8a27bf5e42f711318371acd9a9f74a upstream.

    Since IRQF_NO_SUSPEND used for imx mailbox driver, that means this irq
    can't be used for wakeup source so that can't wakeup from freeze mode.
    Add pm_system_wakeup() to wakeup from freeze mode.

    Fixes: b7b2796b9b31e("mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag")
    Reviewed-by: Jacky Bai <ping.bai@nxp.com>
    Reviewed-by: Peng Fan <peng.fan@nxp.com>
    Signed-off-by: Robin Gong <yibin.gong@nxp.com>
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/mailbox/imx-mailbox.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    --- a/drivers/mailbox/imx-mailbox.c
    +++ b/drivers/mailbox/imx-mailbox.c
    @@ -14,6 +14,7 @@
    #include <linux/module.h>
    #include <linux/of_device.h>
    #include <linux/pm_runtime.h>
    +#include <linux/suspend.h>
    #include <linux/slab.h>

    #define IMX_MU_CHANS 16
    @@ -76,6 +77,7 @@ struct imx_mu_priv {
    const struct imx_mu_dcfg *dcfg;
    struct clk *clk;
    int irq;
    + bool suspend;

    u32 xcr[4];

    @@ -334,6 +336,9 @@ static irqreturn_t imx_mu_isr(int irq, v
    return IRQ_NONE;
    }

    + if (priv->suspend)
    + pm_system_wakeup();
    +
    return IRQ_HANDLED;
    }

    @@ -702,6 +707,8 @@ static int __maybe_unused imx_mu_suspend
    priv->xcr[i] = imx_mu_read(priv, priv->dcfg->xCR[i]);
    }

    + priv->suspend = true;
    +
    return 0;
    }

    @@ -723,6 +730,8 @@ static int __maybe_unused imx_mu_resume_
    imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]);
    }

    + priv->suspend = false;
    +
    return 0;
    }


    \
     
     \ /
      Last update: 2022-04-05 14:07    [W:3.020 / U:0.708 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site