backlight device, suspend/resume... [RANT]

Carsten Haitzler (The Rasterman) raster at openmoko.org
Thu Jul 10 19:25:54 CEST 2008


On Thu, 10 Jul 2008 09:03:14 -0700 Sean McNeil <sean at mcneil.com> babbled:

> andrzej zaborowski wrote:
> > To see anything on the LCD you need the backlight, the LCD controller
> > and various other parts resumed. But if you're checking whether to
> > really resume, or go back to suspend, you don't want to power up
> > anything that's not needed before this check. Userspace is much too
> > late for this. I'd say even the kernel possibly is too late (there's
> > u-boot before). When you hit userspace, all your processes are again
> > in the "RUNNING" state (even before your daemon actually starts to
> > execute), including your mp3 player and anything you had left running
> > when you suspended (imagine the kernel is a zoo and the processes are
> > wild crazy animals, that you free all at once when you let userspace
> > run, somewhere in the mess is your daemon).
> 
> I'm not certain which position you are advocating. I disagree that 
> userspace is too late to check certain conditions. In fact, I would say 
> that only userspace has all the necessary information to make such a 
> determination. Again, there is the example where we are in mem suspend 
> to reduce power consumption. You turned the LCD off because you might 
> awaken for some reason that does not need user interaction - such as an 
> interrupt from gsm because of a change in signal or an sms message. You 
> either don't have to do anything, vibrate, make a sound, etc. Then you 
> go back to sleep. Absolutely no LCD necessary, so we didn't turn it back on.

that fact is until userspace is up- you dont KNOW if u need the screen. gsm
handling is in userspace. protocol decoding is there. it is the userspace app
decoding gsm protocol that will decide if the gsm data coming in warrants there
being something useful on the screen. same if it is VOIP data over tcp/udp, or
it's an isntant message in gaim, or irc or anything else. in the end it is
ALWAYS userspace ... very high up the stack making the decision of "well i need
to display something the user needs to see" ... NOT the kernel. the kernel
cannot in a general sanes sanely ever know this, and al the situations where
you may want to just silently resume, handle the incoming data on gsm, network
or whatever, and log it and go back to sleep, or you may want to actively
involve the user.

the whole discussion is fairly moot - there really is no sane choice, other
than the kernel literally understanding all of these protocols and
situations... and thats what userspace is for anyway! you guys act as if
userspace is this big fat buggy blob that is never able to be trusted to do
something. yes it may have bugs - so does the kernel. it's just that userspace
is where this decision is going to need to be made, so the kernel just needs to
leave it up to userspace and not second-guess it.

-- 
Carsten Haitzler (The Rasterman) <raster at openmoko.org>




More information about the openmoko-kernel mailing list