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 >
Solved! Go to Solution.
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.
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();
}
/**
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.
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();
}
/**
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.