Subject: Re: power management and idle detection on non-x86
To: Jared D. McNeill <>
From: Michael Lorenz <>
List: tech-kern
Date: 05/07/2006 20:26:25
Hash: SHA1


>> I've been working to get some sort of power management into my 
>> sparcbook for a while now and apart from powerhooks in many device 
>> drivers there are a few other things missing.
>> First, we need a way to know when the machine is idle so we can dim 
>> backlight at some point, or fall asleep. What I'd like to have is a 
>> bunch of 'idle timers' - just write the current timestamp into a more 
>> or less global variable whenever the mouse is moved, some key is 
>> pressed etc., probably keep different counters for different devices. 
>> With this we could detect 'idleness' by just comparing these 
>> variables to current time, if enough of them differ by some 
>> predefined value we can take actions. On PCs this is probably handled 
>> by the APM BIOS but on macppc or sparc we don't have anything like 
>> that so we need our own.

> wscons seems like the ideal place to handle this.

Yeah, it's getting all the relevant input anyway.

> Low level hw drivers should be able to register callbacks for certain 
> actions ("dim/standby/suspend display", etc).

Agreed, so far pnozz and tctrl talk to each other in a not exactly 
generic way ( since tctrl controls the backlight but pnozz needs to 
support the ioctl for it ) Maybe something similar to powerhooks? Hmm, 
Cherry wanted to extend the powerhooks interface.

> Now, policy needs to be set in userland.

Of course. But it shouldn't depend on something like X and it should 
probably work reasonably without userland intervention.

> Also, if you sleep, you want to notify powerd that you want to go to 
> sleep so it can run its sleep scripts before powering off -- don't do 
> this directly from the kernel.

Of course. So we can power down / reconfigure / reconnect network 
interfaces and such.

> Also, x86 is interested in this for ACPI. I'd be willing to work with 
> you on this.

Yeah,  wants to know when we're going to sleep / wake up so it can do 
its voodoo with the graphics chip(s). I think something like that is in 
place already but probably linux-specific.

>> So, before I'm wasting my time inventing the wheel the 5th time - do 
>> we have something like this somewhere in the kernel? Should it be 
>> integrated with powerd? What about powerd vs. apmd? Their scopes seem 
>> to overlap quite a bit.
> apmd is dead; the future is powerd.

Ok, that's what my sparcbook is running.

have fun
Version: GnuPG v1.2.4 (Darwin)