On Thu, 27 May 2010 17:38:03 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
No ? We are talking about just letting power management solve the whole
problem for us.
No - because we are not forcing the suspend. The app must go idle. If you
force the suspend of running processes then yes the entire thing goes
castors up - which is why it's a bad idea to do so.
Read the discussion about how the race is avoided at the hardware level.
That race is I think not there and furthermore most drivers get it right
already.
There are several cases
1. IRQ during app layer (ie policy in user space) asking
applications to go passive
- The event occurs, we undo the app layer policy, easy
(or app wakes process and we let it fall through)
2. IRQ after the app layer quiesces its clients
- The task wakes, the app layer won't see it - the app layer
allows suspend as an idle mode. Not a problem - the app is
running the cpu policy manager will see this and not suspend
until the app has been asleep for a bit. The app may well of
course tell the UI layer 'hey I want you back on' and it take
you back to the full on case.
3. IRQ after kernel suspend begins
- The driver will refuse the suspend, we don't suspend, we unwind
the resume so far, the app wakes, we propogate stuff back up to
user space whose policy manager unwinds its position
4. IRQ after driver has done its final checks
- Wake up lines are set
- We suspend
- We immediately get resumed
- We follow the full resume path
This is I believe robust (and has been implemented on some non x86
boxes). It depends on not forcing running tasks into suspend. That is the
key.
Alan
--