imx6 suspend-to-RAM not working with Qt running in Yocto qte-in-use-image

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6 suspend-to-RAM not working with Qt running in Yocto qte-in-use-image

跳至解决方案
2,493 次查看
2gigeng
Contributor II

Suspend to RAM is not working with Qt running in Yocto qte-in-use-image. Both the “mem” option and the “standby” option do not enter suspend.

     qtdemoE -qws &

     echo mem > /sys/power/state

     PM: Syncing filesystems ... done.

     < no more printing >

标签 (3)
0 项奖励
回复
1 解答
1,636 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi,

     I have ever met this issue sometimes, and I have debug into it, the root cause should be caused by race condition of console, there is fix on v3.6 kernel, but I am not sure whether it can be ported to v3.0.35. Below is a simple patch to just remove the console prepare, maybe you can try it to identify whether you met the same issue.

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=a7b12929be6cc55eab2d...

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c

index 449ccc9..0396efa 100644

--- a/kernel/power/suspend.c

+++ b/kernel/power/suspend.c

@@ -91,7 +91,7 @@ static int suspend_prepare(void)

        if (!suspend_ops || !suspend_ops->enter)

                return -EPERM;

-       pm_prepare_console();

+       //pm_prepare_console();

        error = pm_notifier_call_chain(PM_SUSPEND_PREPARE);

        if (error)

@@ -109,7 +109,7 @@ static int suspend_prepare(void)

        usermodehelper_enable();

  Finish:

        pm_notifier_call_chain(PM_POST_SUSPEND);

-       pm_restore_console();

+       //pm_restore_console();

        return error;

}

@@ -250,7 +250,7 @@ static void suspend_finish(void)

        suspend_thaw_processes();

        usermodehelper_enable();

        pm_notifier_call_chain(PM_POST_SUSPEND);

-       pm_restore_console();

+       //pm_restore_console();

}

/**

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,637 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi,

     I have ever met this issue sometimes, and I have debug into it, the root cause should be caused by race condition of console, there is fix on v3.6 kernel, but I am not sure whether it can be ported to v3.0.35. Below is a simple patch to just remove the console prepare, maybe you can try it to identify whether you met the same issue.

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=a7b12929be6cc55eab2d...

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c

index 449ccc9..0396efa 100644

--- a/kernel/power/suspend.c

+++ b/kernel/power/suspend.c

@@ -91,7 +91,7 @@ static int suspend_prepare(void)

        if (!suspend_ops || !suspend_ops->enter)

                return -EPERM;

-       pm_prepare_console();

+       //pm_prepare_console();

        error = pm_notifier_call_chain(PM_SUSPEND_PREPARE);

        if (error)

@@ -109,7 +109,7 @@ static int suspend_prepare(void)

        usermodehelper_enable();

  Finish:

        pm_notifier_call_chain(PM_POST_SUSPEND);

-       pm_restore_console();

+       //pm_restore_console();

        return error;

}

@@ -250,7 +250,7 @@ static void suspend_finish(void)

        suspend_thaw_processes();

        usermodehelper_enable();

        pm_notifier_call_chain(PM_POST_SUSPEND);

-       pm_restore_console();

+       //pm_restore_console();

}

/**

0 项奖励
回复
1,636 次查看
2gigeng
Contributor II

Thank you!  The above patch fixed the issue.  The other patch to vt_ioctl.c (https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=a7b12929be6cc55eab2d...) did not work for me.

0 项奖励
回复