Re: [PATCH 2/2] Fix console handling during suspend/resume

David Brownell
2006-06-25T01:10:54Z

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

On Friday 23 June 2006 11:41 pm, Benjamin Herrenschmidt wrote:
> Also note that it might be useful to implement something I've been
> carrying around as a patch for debugging suspend on the mac, is what I
> call "fake suspend". I did it as a kernel argument that turns the real
> suspend into a fake suspend, but we should be smarter.
>
> The idea is, as I may have described already, to do the whole driver
> suspend/resume without actually putting the system to sleep ...

Wouldn't the most natural way to implement that be to arrange that
the platform's pm_ops.enter(PM_SUSPEND_ON) just does the right thing?
So test-by "echo on > /sys/power/state".

See the attached (but untested) patch; arch/arm/mach-at91rm9200/pm.c
in current GIT shows one way to handle such enter() calls. Maybe
it's a bit more than what you were thinking of, since it requires
real wakeup events to leave that "on" state ... you might be thinking
more like just returning immediately, as if such an event had been
issued. (Arguably both test modes would be useful and there should
be another PM_SUSPEND_* code.)

- Dave

[-- Attachment #2: pmstate.patch --]
[-- Type: text/x-diff, Size: 473 bytes --]

Index: pm-tmp/kernel/power/main.c
===================================================================
--- pm-tmp.orig/kernel/power/main.c 2006-06-24 17:46:31.000000000 -0700
+++ pm-tmp/kernel/power/main.c 2006-06-24 17:50:27.000000000 -0700
@@ -146,6 +146,7 @@ static void suspend_finish(suspend_state

static char *pm_states[PM_SUSPEND_MAX] = {
+ [PM_SUSPEND_ON] = "on",
[PM_SUSPEND_STANDBY] = "standby",
[PM_SUSPEND_MEM] = "mem",
#ifdef CONFIG_SOFTWARE_SUSPEND

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