[systemd-devel] [PATCH] Add support for Intel Rapid Start

Bastien Nocera hadess at hadess.net
Sun Oct 13 13:09:28 PDT 2013


On Sun, 2013-10-13 at 20:57 +0100, Matthew Garrett wrote:
> On Sun, Oct 13, 2013 at 09:50:59PM +0200, Bastien Nocera wrote:
> 
> > +        r = read_one_line_file("/sys/bus/acpi/devices/INT3392:00/wakeup_events", &p);
> 
> /sys/bus/acpi/drivers/intel_rapid_start/*/wakeup_events would be better, 
> if there's any way to use wildcards here. It's possible that later 
> models will change the ACPI ID while still exposing the same userspace 
> UI.

There's no way to use globs here, but I can look for the first directory
under there, would that be enough? systemd developers, is there a helper
for that already?

> > +        /* We only support rapid start if we have both values set:
> > +         * 1: Wake to enter hibernation when the wakeup timer expires
> > +         * 2: Wake to enter hibernation when the battery reaches a
> > +         * critical level */
> > +        if (p[0] == '3' && p[1] == '\0')
> > +                return true;
> 
> That seems a little harsh - not all firmware exposes the settings for 
> this. I think it's legitimate to just program it yourself.

Then we shouldn't check the value, and set it, but I'm not sure I should
be doing that in the has_rapid_start() function.

I guess that in the future, we should allow setting and modifying the
wakeup timer value, but I'd want to figure out if and how to present it
in the UI before that. I'd be happy with a decent default value like 2
hours and be done with it.

I'll wait for the systemd developers to tell me how they like that patch
before respinning it with your comments.

Cheers



More information about the systemd-devel mailing list