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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,533 Views
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 >

Labels (3)
0 Kudos
1 Solution
676 Views
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();

}

/**

View solution in original post

0 Kudos
2 Replies
677 Views
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 Kudos
676 Views
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 Kudos