Tobias Diedrich wrote:Doesn't apply cleanly against -rc6, but fixes the problem when reverted from -rc1. Index: linux-2.6.21-rc1/kernel/power/disk.c =================================================================== --- linux-2.6.21-rc1.orig/kernel/power/disk.c 2007-04-14 14:16:59.000000000 +0200 +++ linux-2.6.21-rc1/kernel/power/disk.c 2007-04-14 14:17:03.000000000 +0200 @@ -87,24 +87,52 @@ } } -static void unprepare_processes(void) -{ - thaw_processes(); - pm_restore_console(); -} - static int prepare_processes(void) { int error = 0; pm_prepare_console(); + + error = disable_nonboot_cpus(); + if (error) + goto enable_cpus; + if (freeze_processes()) { error = -EBUSY; - unprepare_processes(); + goto thaw; } + + if (pm_disk_mode == PM_DISK_TESTPROC) { + printk("swsusp debug: Waiting for 5 seconds.\n"); + mdelay(5000); + goto thaw; + } + + error = platform_prepare(); + if (error) + goto thaw; + + /* Free memory before shutting down devices. */ + if (!(error = swsusp_shrink_memory())) + return 0; + + platform_finish(); + thaw: + thaw_processes(); + enable_cpus: + enable_nonboot_cpus(); + pm_restore_console(); return error; } +static void unprepare_processes(void) +{ + platform_finish(); + thaw_processes(); + enable_nonboot_cpus(); + pm_restore_console(); +} + /** * pm_suspend_disk - The granpappy of hibernation power management. * @@ -122,45 +150,29 @@ if (error) return error; - if (pm_disk_mode == PM_DISK_TESTPROC) { - printk("swsusp debug: Waiting for 5 seconds.\n"); - mdelay(5000); - goto Thaw; - } - /* Free memory before shutting down devices. */ - error = swsusp_shrink_memory(); - if (error) - goto Thaw; - - error = platform_prepare(); - if (error) - goto Thaw; + if (pm_disk_mode == PM_DISK_TESTPROC) + return 0; suspend_console(); error = device_suspend(PMSG_FREEZE); if (error) { - printk(KERN_ERR "PM: Some devices failed to suspend\n"); - goto Resume_devices; + resume_console(); + printk("Some devices failed to suspend\n"); + goto Thaw; } - error = disable_nonboot_cpus(); - if (error) - goto Enable_cpus; if (pm_disk_mode == PM_DISK_TEST) { printk("swsusp debug: Waiting for 5 seconds.\n"); mdelay(5000); - goto Enable_cpus; + goto Done; } pr_debug("PM: snapshotting memory.\n"); in_suspend = 1; - error = swsusp_suspend(); - if (error) - goto Enable_cpus; + if ((error = swsusp_suspend())) + goto Done; if (in_suspend) { - enable_nonboot_cpus(); - platform_finish(); device_resume(); resume_console(); pr_debug("PM: writing image.\n"); @@ -176,10 +188,7 @@ } swsusp_free(); - Enable_cpus: - enable_nonboot_cpus(); - Resume_devices: - platform_finish(); + Done: device_resume(); resume_console(); Thaw: @@ -228,28 +237,19 @@ pr_debug("PM: Checking swsusp image.\n"); - error = swsusp_check(); - if (error) + if ((error = swsusp_check())) goto Done; pr_debug("PM: Preparing processes for restore.\n"); - error = prepare_processes(); - if (error) { + if ((error = prepare_processes())) { swsusp_close(); goto Done; } - error = platform_prepare(); - if (error) { - swsusp_free(); - goto Thaw; - } - pr_debug("PM: Reading swsusp image.\n"); - error = swsusp_read(); - if (error) { + if ((error = swsusp_read())) { swsusp_free(); goto Thaw; } @@ -257,22 +257,21 @@ pr_debug("PM: Preparing devices for restore.\n"); suspend_console(); - error = device_suspend(PMSG_PRETHAW); - if (error) - goto Free; + if ((error = device_suspend(PMSG_PRETHAW))) { + resume_console(); + printk("Some devices failed to suspend\n"); + swsusp_free(); + goto Thaw; + } - error = disable_nonboot_cpus(); - if (!error) - swsusp_resume(); + mb(); - enable_nonboot_cpus(); - Free: - swsusp_free(); - platform_finish(); + pr_debug("PM: Restoring saved image.\n"); + swsusp_resume(); + pr_debug("PM: Restore failed, recovering.n"); device_resume(); resume_console(); Thaw: - printk(KERN_ERR "PM: Restore failed, recovering.\n"); unprepare_processes(); Done: /* For success case, the suspend path will release the lock */ -- Tobias PGP: http://9ac7e0bc.uguu.de このメールは十割再利用されたビットで作られています。 -
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| Greg Kroah-Hartman | [PATCH 022/196] adb: Convert from class_device to device |
git: | |
| Jakub Narebski | Re: VCS comparison table |
| Mark Levedahl | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Matthieu Moy | git push to a non-bare repository |
| Jon Smirl | Re: Calculating tree nodes |
| Marco Peereboom | Re: Real men don't attack straw men |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Tony Abernethy | Re: What is our ultimate goal?? |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Andy Grover | [PATCH] RDS: Add AF and PF defines for RDS sockets |
| David Miller | Re: [PATCH] inet6: Fix paramater issue of inet6_csk_xmit |
