Re: [PATCH 01/13] PM: Add wake lock api.

Alan Stern
2009-03-08T12:34:09Z

On Sun, 8 Mar 2009, Pavel Machek wrote:

> > I don't know the details of sleepy linux so I'd appreciate if someone can
> > eluminate if the following scenarios could be handled efficiently with sleepy
> > linux:
> > 1) You wake up through RTC, read the battery, update the color of your
> > fancy 'battery good' LED and go back to sleep imediately. The real work
> > takes milliseconds.
>
> This should work.
>
> > 2) You send a request to the internet and go idle by selecting for an answer.
> > You probably don't want to go to sleep as you know, the answer will be
> > there shortly.
>
> Way to get this to work would be to keep the system woke up 300msec or
> so after each network packet -- assuming that if one came another is
> probably coming soon.

That sounds like a perfect use for a suspend_blocker with a timeout!

Alan Stern