http://bugme.osdl.org/show_bug.cgi?id=3670 ------- Additional Comment #6 From Bastien Nocera 2004-11-01 16:03 ------- It wakes up great now, with 2.6.9, however, the video doesn't come back up, as you noted. Do you know which tool to use to bring the video back up? I tried spicctrl, to try and change the brightness, and radeontool, to turn the DAC and lights on and off, neither worked. ------- Additional Comment #7 From Zhu Yi 2004-11-01 17:54 ------- Created an attachment (id=3929) video_post tool from Venki ------- Additional Comment #8 From Zhu Yi 2004-11-01 17:56 ------- See README for details. I used it as "echo 3 > /proc/acpi/sleep && /root/emu/video_post". The only problem is it discards the "screen expansion" BIOS option, so I can only get a small screen after resume. Please let me know how is it going on your laptop. ------- Additional Comment #9 From Bastien Nocera 2004-11-03 14:45 ------- Thanks a lot, Zhu Yi. The video_post tool fixed my last problem with sleep, everything works fine now. Can the bug be closed? ------- Additional Comment #10 From Venkatesh Pallipadi 2004-11-03 15:57 ------- Nice to see the userlevel tool worked for you. I will like to keep this bug open until this bug is fixed kernel/user utility, without the user having to run this tool. Also, I think there are many other bugs in the bugzilla with similar problems. Probably we can mark all of them duplicates of this one. -Venki ------- Additional Comment #11 From Venkatesh Pallipadi 2004-11-04 10:15 ------- Created an attachment (id=3961) Patch to invoke vga_post from kernel If the above vga_post utility helps you to get back the text console after S3 suspend-resume, you can use the attached patch to invoke that utility from kernel directly (Please note the path for video_post in the patch should match the patch where you have installed it). The advantage being, this will make the Xwindows work after resume as well. This still doesn't help framebuffer consoles. ------- Additional Comment #12 From Bastien Nocera 2004-11-04 10:53 ------- Venkatesh, surely, this should be done in either the X driver, or in the framebuffer driver, not in user-space called from the kernel. Or they should be a way to change the path to the command-line tool, as /proc/sys/kernel/hotplug allows for the hotplug subsystem. --- linux-2.6.9-rc2/kernel/power/main.c.org 2004-09-12 18:23:00.671546520 -0700 +++ linux-2.6.9-rc2/kernel/power/main.c 2004-09-12 18:22:27.548581976 -0700 @@ -106,13 +106,29 @@ static int suspend_enter(u32 state) * console that we've allocated. */ +int vgapost_usermode(void) +{ + char *argv[3] = {NULL, NULL, NULL}; + char *envp[3] = {NULL, NULL, NULL}; + + argv[0] = "/root/emu/video_post"; + + /* minimal command environment */ + envp[0] = "HOME=/"; + envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; + + return call_usermodehelper(argv[0], argv, envp, 1); +} + static void suspend_finish(u32 state) { int retval; device_resume(); if (pm_ops && pm_ops->finish) pm_ops->finish(state); + thaw_processes_kernel(); + retval = vgapost_usermode(); thaw_processes(); pm_restore_console(); --- linux-2.6.9-rc2/kernel/power/process.c.org 2004-09-12 18:21:48.266553752 -0700 +++ linux-2.6.9-rc2/kernel/power/process.c 2004-09-12 18:22:06.851728376 -0700 @@ -97,6 +97,29 @@ int freeze_processes(void) return 0; } +void thaw_processes_kernel(void) +{ + struct task_struct *g, *p; + + printk( "Restarting kernel tasks..." ); + read_lock(&tasklist_lock); + do_each_thread(g, p) { + if (!freezeable(p)) + continue; + if (p->parent->pid != 1) + continue; + if (p->flags & PF_FROZEN) { + p->flags &= ~PF_FROZEN; + wake_up_process(p); + } else + printk(KERN_INFO " Strange, %s not stopped\n", p->comm ); + } while_each_thread(g, p); + + read_unlock(&tasklist_lock); + schedule(); + printk( " done\n" ); +} + void thaw_processes(void) { struct task_struct *g, *p; @@ -106,6 +129,8 @@ void thaw_processes(void) do_each_thread(g, p) { if (!freezeable(p)) continue; + if (p->parent->pid == 1) + continue; if (p->flags & PF_FROZEN) { p->flags &= ~PF_FROZEN; wake_up_process(p);