FS#33262 - [systemd] systemd suspend changes APM level
Attached to Project:
Arch Linux
Opened by Lukas Jirkovsky (6xx) - Tuesday, 01 January 2013, 10:24 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 13 November 2013, 18:14 GMT
Opened by Lukas Jirkovsky (6xx) - Tuesday, 01 January 2013, 10:24 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 13 November 2013, 18:14 GMT
|
Details
Description:
When "systemctl suspend" is used to suspend a machine, the APM level is not correctly restored upon wakeup. Maybe there are other settings that are not correctly restored too, but this is a visible one. Additional references: * https://bbs.archlinux.org/viewtopic.php?id=150121 * https://bugs.archlinux.org/task/32465 Additional info: * systemd 196-2, but it is likely to be an issue since systemd 191 or 192 according to forum * no specific configuration Steps to reproduce: * set APM level to a non-default one, eg. hdparm -B 254 /dev/sda * systemctl suspend (also upower as described in the Arch wiki can be used) * wakeup * check APM level using hdparm -B /dev/sda - it may be necessary to do more suspend-resume cycles, on my laptop the settings are correctly restored on the first wakeup, but consecutive suspend/wakeups always exhibit the problem. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Wednesday, 13 November 2013, 18:14 GMT
Reason for closing: Upstream
Wednesday, 13 November 2013, 18:14 GMT
Reason for closing: Upstream
1) the behavior should be deterministic, not like this (it's often restored for the first time, but not later).
2) this behavior is a serious step back (I dare to say it's a regression), because pm-suspend didn't have such issue.
3) it doesn't make any sense to randomly change settings by doing suspend/resume. If it's possible to recover the settings, systemd should do so. If it is possible to configure systemd in such way, it should be the default configuration.
I don't know how to verify whether is it a kernel bug. If you could point me where to look, I'd be happy to help.
pm-utils has a collection of scripts it runs on suspend/resume in order to (usually) fix kernel issues. systemd also has support for this (see systemd-suspend.service(8)), but by default we don't ship any. As a temporary workaround you could put the correct script in that dir (must be edited slightly, see manpage). However, a permanent fix should be to the kernel so nothing like this is needed at all.
Anyway, it would be nice if the systemd provided default script to restore everything by default though.
so I think it is time to figure out some solution to this annoying bug.
my laptop is thinkpad x230 with the newest kernel installed.
btw what is the script? where can I find it?
Tell me if I am reporting a new bug instead.
32bit Arch Linux on HP 6710b laptop
Many thanks,
/etc/laptop-mode/laptop-mode.conf:
CONTROL_HD_IDLE_TIMEOUT=1
#
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
#
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=60
LM_AC_HD_IDLE_TIMEOUT_SECONDS=360
NOLM_HD_IDLE_TIMEOUT_SECONDS=1800
#
# Should laptop mode tools control the hard drive power management settings?
#
# Set to 0 to disable default=auto
CONTROL_HD_POWERMGMT="1"
# Power management for HD (hdparm -B values)
BATT_HD_POWERMGMT=128
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
/etc/laptop-mode/conf.d/cpufreq.conf:
CONTROL_CPU_FREQUENCY="1"
# Legal values are "slowest" for the slowest speed that your
# CPU is able to operate at, "fastest" for the fastest speed,
# "medium" for some value in the middle, or any value listed in
# /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
# The "governor" can be any governor installed on your system, this usually
# includes "ondemand", "conservative", and "performance". The
# "IGNORE_NICE_LOAD" setting specifies that background programs that have
# a low priority ("nice level") should not cause the CPU frequency to
# be increased. (You generally want this to be enabled in battery mode.)
#
BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=conservative
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=conservative
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=ondemand
NOLM_AC_CPU_IGNORE_NICE_LOAD=1
# Should laptop mode tools control the CPU throttling? This is only useful
# on processors that don't have frequency scaling.
# (Only works when you have /proc/acpi/processor/CPU*/throttling.)
#
# This is only useful on older P4 processors that do not support frequency
# scaling. On such processors, this is the only way to reduce power consumption
# but at the cost of higher performance penalty.
#
# Enable this only if you have a processor that does not support frequency scaling
# On most new processors, you might want to disable it.
#
# Set to 0 to disable.
CONTROL_CPU_THROTTLING=0
#
# Legal values are "maximum" for the maximum (slowest) throttling level,
# "minimum" for minimum (fastest) throttling level, "medium" for a value
# somewhere in the middle (this is usually 50% for P4s), or any value listed
# in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
# this may be _very_ slow (in fact, with P4s it slows down the processor
# by a factor 8).
#
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=medium
NOLM_AC_CPU_THROTTLING=minimum
btw, I disabled the systemctl suspend funtion according to the Arch wiki(systemctl). and now i suspend my computer by running pm-suspend first and then close the Lid. although its not very convinient but i cant find another way.
cpufreq.conf (3.1 KiB)
Cheers,
sledge
Laptop: HP 6710b