tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: powerd on boot



Simon Burge wrote:
Christoph Egger wrote:

I have a driver which implements support for PNP0C32 acpi hotkeys
(aka "Direct Application Launch Buttons, http://www.microsoft.com/whdc/system/vista/DirAppLaunch.mspx)

Those allow to turn on / resume a machine and generate an ACPI event
on boot.
My driver catches it and injects it into sysmon _before_ powerd
starts.

When powerd starts I expect it to run /etc/powerd/scripts/hotkey_button,
but that doesn't happen. But why?

sys/dev/sysmon/sysmon_power.c:sysmonopen_power() calls
sysmon_power_event_queue_flush() on open to flush any existing
events.

I'm not sure why this is done - it's been that way since the
open function existed.

Just for fun, you could try commenting out the call
sysmon_power_event_queue_flush() and see if that give you the
behaviour you want.

Tried that. No difference.
I think, the bug is in sysmon_pswitch_event(). The event is only
stored when the daemon is running.

The problem, sysmon_power_daemon is NULL when powerd is not running.
So when I inject the even into sysmon (which is _before_ powerd) runs,
the event is lost.

Any ideas on how to fix that?

Christoph


Home | Main Index | Thread Index | Old Index