lkml.org 
[lkml]   [2011]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [: [RFC] wake up notifications and suspend blocking (aka more wakelock stuff)]
On Mon, 24 Oct 2011, mark gross wrote:

> > > Timeout? why can't we define a proper notification handshake for such
> > > things? Timeouts are never right IMO.
> > >
> >
> > I thought that before, but I have come around to the opposite way of thinking
> > thanks to some instructive examples from Alan and Rafael.
> >
> > Some things are simply not visible to the OS. We can expect them to be
> > happening but we cannot be sure and there is no clear signal that they aren't
> > actually happening. So we need a timeout.
>
> um

> > - USB cannot (I think) know which USB device triggered a wake-from-suspend,
> > and in any case cannot directly ask the device why it woke from suspend.
> > It has to wait for the device to tell it (in response to a regular
> > 'interrupt' poll I assume - but it isn't guaranteed to be reported on the
> > first poll) - or timeout and give up waiting.
> maybe if you are unwilling to change the user mode stack that is reading
> these events. But if you where they you shouldn't need time outs.

Remember, here we are talking about timeouts in the kernel stack, not
in the user-mode stack.

So consider this theoretical situation (which is not very different
from reality): The system gets a wakeup signal. Sometime in the next
30 ms or less, there may or may not be an input event -- the kernel has
no way to tell other than wait and see.

The kernel could simply go right back to sleep without waiting, but if
it does and there is a pending input event, then very quickly it will
get another wakeup signal, and it'll be right back where it started --
trying to decide whether to stay awake for the next 30 ms.

Can you suggest a way to handle this other than using a timeout?

Alan Stern



\
 
 \ /
  Last update: 2011-10-25 17:17    [W:0.099 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site