Messages in this thread | | | Date | Mon, 14 May 2012 05:02:54 +0530 | From | "Srivatsa S. Bhat" <> | Subject | Re: [PATCH]: In kernel hibernation, suspend to both |
| |
On 05/09/2012 04:41 PM, Bojan Smojver wrote:
> Bojan Smojver <bojan@rexursive.com> wrote: > >> Honest answer - I have absolutely no idea. I've seen the code of >> suspend-utils (i.e. user mode stuff) and it seems to me that it does >> exactly this. Could be wrong of course, just like many times before. > > What makes me think that this may not be that bad is the fact that
> post-resume, it will actually be hibernation code that will be unwinding
> things. So like this: prepare for hibernation, create image, suspend to
> memory
This is the point where your patch gets scary - Suspend is not carried out in its fullest sense; instead you jump directly to suspend_devices_and_enter(). Luckily, most of the things that happen before this are common between suspend and hibernation. However, one thing that really stands out is the notifications: if you directly call suspend_devices_and_enter(), we end up missing the PM_SUSPEND_PREPARE notifications.
And there is no guarantee that everybody implements the same thing for both PM_SUSPEND_PREPARE and PM_HIBERNATION_PREPARE notifications. That is the reason I don't think it is safe.
> (equivalent to hibernation failure of some kind, really), resume
>from memory, unwind from unsuccessful hibernation. > > No? >
Regards, Srivatsa S. Bhat IBM Linux Technology Center
| |