[patch/rft 2.6.17-rc5-git 6/6] PM_EVENT_PRETHAW, issue from PM core

David Brownell
2006-06-05T16:38:49Z

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

This converts the PM core to issue the new PRETHAW message. The rest of
the kernel is now ready to receive these, courtesy of preceding patches.
---
kernel/power/disk.c | 4 ++--
kernel/power/swsusp.c | 9 ++++++++-
kernel/power/user.c | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)

[-- Attachment #2: prethaw-core.patch --]
[-- Type: text/x-diff, Size: 2628 bytes --]

This converts the PM core to issue the new PRETHAW message. The rest of
the kernel is now ready to receive these, courtesy of preceding patches.

---
kernel/power/disk.c | 4 ++--
kernel/power/swsusp.c | 9 ++++++++-
kernel/power/user.c | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)

Index: scratch/kernel/power/swsusp.c
===================================================================
--- scratch.orig/kernel/power/swsusp.c 2006-06-05 09:06:46.000000000 -0700
+++ scratch/kernel/power/swsusp.c 2006-06-05 09:20:01.000000000 -0700
@@ -240,6 +240,9 @@ int swsusp_suspend(void)
restore_processor_state();
Restore_highmem:
restore_highmem();
+ /* NOTE: device_power_up() is just a resume() for devices
+ * that suspended with irqs off ... no overall powerup.
+ */
device_power_up();
Enable_irqs:
local_irq_enable();
@@ -249,8 +252,12 @@ Enable_irqs:
int swsusp_resume(void)
{
int error;
+
local_irq_disable();
- if (device_power_down(PMSG_FREEZE))
+ /* NOTE: device_power_down() is just a suspend() with irqs off;
+ * it has no special "power things down" semantics
+ */
+ if (device_power_down(PMSG_PRETHAW))
printk(KERN_ERR "Some devices failed to power down, very bad\n");
/* We'll ignore saved state, but this gets preempt count (etc) right */
save_processor_state();
Index: scratch/kernel/power/user.c
===================================================================
--- scratch.orig/kernel/power/user.c 2006-06-05 09:06:46.000000000 -0700
+++ scratch/kernel/power/user.c 2006-06-05 09:20:01.000000000 -0700
@@ -191,7 +191,7 @@ static int snapshot_ioctl(struct inode *
}
down(&pm_sem);
pm_prepare_console();
- error = device_suspend(PMSG_FREEZE);
+ error = device_suspend(PMSG_PRETHAW);
if (!error) {
error = swsusp_resume();
device_resume();
Index: scratch/kernel/power/disk.c
===================================================================
--- scratch.orig/kernel/power/disk.c 2006-06-05 09:06:46.000000000 -0700
+++ scratch/kernel/power/disk.c 2006-06-05 09:20:01.000000000 -0700
@@ -98,7 +98,7 @@ static void unprepare_processes(void)
}

/**
- * pm_suspend_disk - The granpappy of power management.
+ * pm_suspend_disk - The granpappy of hibernation power management.
*
* If we're going through the firmware, then get it over with quickly.
*
@@ -207,7 +207,7 @@ static int software_resume(void)

pr_debug("PM: Preparing devices for restore.\n");

- if ((error = device_suspend(PMSG_FREEZE))) {
+ if ((error = device_suspend(PMSG_PRETHAW))) {
printk("Some devices failed to suspend\n");
swsusp_free();
goto Thaw;

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]