[systemd-devel] RFC: enable suspend to idle
Lennart Poettering
lennart at poettering.net
Thu Mar 1 14:17:14 UTC 2018
On Do, 01.03.18 14:40, Thomas Blume (Thomas.Blume at suse.com) wrote:
> Hi,
>
> It seems that major vendors are dropping support of sleep mode S3 in favor of
> the new suspend to idle method.
> We need to enable this new feature in order to be able to suspend to RAM on
> such machines.
> The kernel side of this feature has already been implemented:
>
> https://patchwork.kernel.org/patch/9873163
>
> but we need to activate it in userspace.
> Each device, supporting suspend to idle from kernel side, has a file called
> wakeup in sysfs.
> Echoing "enabled" into this file will enable the feature.
>
> As a proof of concept, I have created below udev rule and helper script, which
> works on my testmachine.
> Obviously, like that it isn't portable to other distros, but I'd like to get
> comments whether this is the way to go.
> If I get positive feedback, I'll try a portable approach using a binary helper.
>
> udev rule:
>
> -->
> ACTION=="add", ATTR{power/wakeup}=="disabled", IMPORT{program}="/usr/lib/udev/get-wakeup-devices.sh %p"
> ENV{RESUME_FROM_IDLE}=="1", ATTR{power/wakeup}="enabled"
Not following here. This doesn't appear like something where userspace
should be involved. We generally avoid udev rules whose only job is to
"shortcut" kernel events back into the kernel. Why doesn't the kernel
set this up properly anyway on its own?
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list