[Pm-utils] Canceling resume

Victor Lowther victor.lowther at gmail.com
Thu Nov 19 08:34:44 PST 2009


On Nov 19, 2009, at 9:12 AM, Enrico Zini <enrico at enricozini.org> wrote:

> On Thu, Nov 19, 2009 at 05:58:22AM -0800, Dan Nicholson wrote:
>
>>> Is it possible for a resume script in pm-utils to say "Ok, I took  
>>> care
>>> of it, don't bother running the rest, let's go back to sleep" ?
>>
>> The bulk of the resume is handed in the kernel. pm-utils just adds a
>> little bit on top to pull it all together and has nothing to do with
>> actually resuming the hardware. If you really need to block a resume,
>> it should happen in the kernel. You could write a hook that
>> immediately suspends again, but it would be a pretty nasty user
>> experience.
>
> Sorry, maybe I haven't been clear enough.
>
> There is a need to resume and do something in user space, and I don't
> see how dealing it in kernel would help: one example was to read the  
> fix
> from the GPS and write it in a file, then go back to sleep.

As Dan said, right now it is all or nothing. Pm-utils knows how to  
abort a suspend before it hits the kernel, but it has no idea how to  
abort a resume and go back to sleep - it is not a use case we designed  
for.

> However, upon resume pm-utils will run the various scripts in /etc/ 
> pm in
> order. The idea would be to have a hook, say, 80-openmoko, that tells
> pm-utils: "forget it, we need to go back to sleep".  And at that point
> pm-utils will:
> 1. stop running further resume scripts
> 2. start running suspend hooks starting from the one that canceled the
>    resume 80-openmoko
> 3. suspend again

It seems like a reasonable request, nut it is not obvious how to  
implement it in a general way.

>
> This would allow to deal with the special resume reason without  
> running
> all scripts up the chain and then down again. This could give a
> considerable gain in reaction time and power consumption.
>
> I guess from your reply that it's not currently possible to do so.
> If I tried to look into implementing such a feature, would it be
> considered worth having?

Depends on how clean the code is. :)

>
> Ciao,
>
> Enrico
>
> -- 
> GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <enrico at enricozini.org>
> _______________________________________________
> Pm-utils mailing list
> Pm-utils at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pm-utils


More information about the Pm-utils mailing list