[Gta04-owner] Kernel update for gta04
Neil Jerram
neil at ossau.homelinux.net
Sun Jul 8 13:30:00 CEST 2012
NeilBrown <neilb at suse.de> writes:
> Neither.
> To get race-free suspend you need support in the kernel and in user-space.
> The kernel side requires that wakeup-events identify themselves. Last I
> checked, *nothing* in the kernel identifies as a "wakeup source". My kernel
> changes told the power-button, aux-button, RTC alarm and 3G interrupt to
> identify themselves as wakeup sources.
>
> The user-space side is what I was trying to outline here.
Ah, many thanks for explaining that, and to Radek for the LWN link.
>> > The simplest way to avoid races with suspend is:
>> > - read /sys/power/wakeup_count and record the number
>> > - final check that no buttons are pressed etc
>> > - write the recorded number to /sys/power/wakeup_count
>> > - If that succeeds, write "mem" to /sys/power/state
But isn't it obvious that (1) there's still a window here, between the
last two lines, and (2) this could and should all be handled within the
kernel?
> As of 3.5 there is code in the kernel which does the core part of this.
> Whether that is easier or harder to use remains to be seen. It was added
> because that is more like how Android works.
So in 3.5 the race is correctly handled within the kernel, and the user
space complexity disappears again?
If so, that sounds like the right thing to me.
> I have a bunch of little bits and pieces that I wrote myself - because I'm a
> NIH kind of guy. Mostly python with bits of C when needed.
> Being in control of, and very familiar, with all the code makes it easy to
> experiment with auto-suspend etc, and is a great learning experience :-)
>
> I'm occasionally tempted to use QTMoko because it is much more complete and
> generally nicer than the bits I've hacked together, but then I'd probably
> need to learn Qt, and maybe even C++, to do any programming and I'm not sure
> I really want to.
Interesting, thanks. Regarding Qt/C++ though, I can't say I've learnt
them properly, but in practice I've still found the QtMoko codebase
quite easy to understand and hack. (But perhaps that just means I
haven't been bitten by a serious mistake yet... :-).)
Regards,
Neil
More information about the Gta04-owner
mailing list