[Pm-utils] Question about hooks and suspend-hybrid.
Victor Lowther
victor.lowther at gmail.com
Thu Jun 26 19:00:44 PDT 2008
On Thu, 2008-06-26 at 14:02 +0200, Stefan Seyfried wrote:
> Hi,
>
> I'm right now implementing suspend-hybrid for the original pm-utils, and was
> wondering, how the handling in the hooks is supposed to be (i want my version
> to be compatible with Victor's).
>
> - there is only one hook (01grub) that even takes the suspend_hybrid parameter
> - there i no resume_hybrid at all
> - the hook-running code does never pass the suspend_hybrid parameter to any code.
>
> So how is this supposed to work? Reading the HOWTO.hooks also did not provide
> any clues.
A good guideline is "on a suspend_hybrid, run whichever of the suspend
or hibernate hooks saves the most state". For the grub hook, that would
be the hibernate hook. For the video hooks, that would be the suspend
hook.
> Actually looking at src/pm-action.in it seems that for suspend_hybrid, also
> plain "suspend" and "resume" actions are given to the hooks, but this is of
> course not entirely correct, and it is contrary to the documentation in
> HOWTO.hooks...
More like the documentation documents a case we do not yet handle, and
the code assumes that if anyone is actually using suspend_hybrid, in
practice it ends up being a normal suspend/resume cycle the majority of
the time. Not a perfect way to handle things, granted, but without a
way of telling what mode we woke up from the least confusing to code
for.
> Might i suggest we use a "suspend_hybrid"/"resume_hybrid"-combination for
> telling the hooks what to do?
I do not think that a resume_hybrid flag is the right thing to do -- it
does not correspond to an actual wakeup state, we will always be either
resuming from suspend or hibernate. What we need is for the kernel to
actually be able to tell us that information so that we can run the
power hooks with the appropriate parameter for the state we are actually
waking up from.
>
> Thanks,
>
> Stefan
--
Victor Lowther
Ubuntu Certified Professional
More information about the Pm-utils
mailing list