RFC: enable suspend to idle

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

 



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


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux