Bug 916

Summary: beagleboard: apmd complains about lack of APM support in kernel
Product: [Build System, Metadata & Runtime] BSPs Reporter: Paul Eggleton <bluelightning>
Component: bsps-runtimeAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: dvhart, jessica.zhang, liming.wang, yi.zhao, yp.kernel.watcher, yp.watcher
Version: 1.0   
Target Milestone: 1.1   
Hardware: Beagleboard   
OS: arm   
Whiteboard: Patch submitted to list (24-Aug- 2011)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Paul Eggleton 2011-03-21 09:40:26 UTC
With a beagleboard image created from bernard + meta-demo (dvhart/bbxm branch) I noticed that during startup apmd reports:

------------
Starting advanced power management daemon: No APM support in kernel
(failed.)
------------

Kernel version is 2.6.37.3-yocto-standard+.

bernard revision used to build was 82af8b9fb6d6d1439943fd15b8a75c0e663e4a45 (although it was not a from-scratch build).
Comment 1 Bruce Ashfield 2011-03-21 13:22:32 UTC
Tossing this onto the beagleboard 1.1 pile.
Comment 2 Darren Hart 2011-06-06 13:10:21 UTC
I think the solution here is to remove apmd. I could be wrong - but this seems to be common even on the Angstrom distribution, while "echo mem > /sys/power/state" does start the suspend process (which currently fails, but...). I'm not sure what the requirements are for apmd to work and when one should expect to use apmd rather than the sys interface.
Comment 3 Darren Hart 2011-06-06 15:57:12 UTC
From what I can gather apmd is mostly obsoleted by acpid, which is mostly obsoleted by the various power management daemons of modern desktops. I don't know what we need to do with oe-core in general, but for the Yocto beagleboard image I'd just suggest dropping apmd altogether.
Comment 4 Liming Wang 2011-08-11 00:09:04 UTC
I also suggest to drop this package.
apmd prints " No APM support in kernel" when it accesses "/proc/apm". The file "/proc/apm" is created in drivers/char/apm-emulation.c and it contains such "AC line status" and "Battery status" information. But beagleboard doesn't have battery and so apmd can't provide useful information.
If we don't drop this package from beagleboard machine, we can add CONFIG_APM_EMULATION option to the kernel config to avoid this message.
Comment 5 Bruce Ashfield 2011-08-11 12:16:30 UTC
I went ahead and submitted the change to remove this from the board.
Comment 6 Bruce Ashfield 2011-08-12 06:49:49 UTC
Logging the email discussions on this change.

>> On arm it used to be the case that this was the only way to expose user
>> > > interface to suspend/resume the machine. Its not so much about their
>> > > being hardware present for it as the whole kernel side was emulation of
>> > > the user space notification part.
>> > >
>> > > Has something changed in recent kernels in this area?
> > 
> > I won't claim to be an expert here .. but I haven't used apmd
> > on many machines in quite a while. Assuming suspend_ops is
> > implemented, it is typically just something ike this:
> > 
> >   echo mem > /sys/power/state
> > 
> >     or
> > 
> >   echo standby > /sys/power/state
> > 
> > With a wakeup via the rtc, or whatever the board offers. I'm
> > cc'ing Liming on this, since he's been poking at the board recently
> > and may have more hands on information to share.
> > 
> > If we ARE removing this capability, then we'll take the other option
> > that we had for this case and enable the emulation.
I have a suspicion that certain parts of the sato code do
assume /dev/apm_bios device emulation is present to get userspace
notification of suspend/resume events which the above doesn't provide
last I checked.

Likely this isn't an issue and I think that code in sato (matchbox panel
app iirc) is toggled by the MACHINE_FEATURES but its certainly worth
keeping in mind...
Comment 7 Bruce Ashfield 2011-08-12 06:51:08 UTC
Liming: can we look into Richard's concerns and see what does/doesn't work with the change removed. It could be better to just add the emulation support. I'm thinking that we should just do this versus dropping APM.

Also. Check the other meta layers for the beagleboard, there's no sense
reinventing anything here.
Comment 9 Yi Zhao 2011-09-09 01:52:58 UTC
Verified with 20110908 build. 

Tree/Branch: stage/master_under_test
Poky Commit:5fa508a717da07ef7352e4ac385ac276156aedec

The apm daemon can start without errors.

############
root@beagleboard:~# ps aux|grep apmd
root        35  0.0  0.0      0     0 ?        S    15:57   0:00 [kapmd]
root     17889  0.0  0.1   1656   368 ?        Ss   16:46   0:00 /usr/sbin/apmd -P /etc/apm/apmd_proxy --proxy-timeout 30
root     17902  0.0  0.2   2180   532 ttyO2    S+   16:48   0:00 grep apmd
##############