summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQue Quotion2017-04-06 09:00:08 +0900
committerQue Quotion2017-04-06 09:00:08 +0900
commit66609e790efbe0510e795fcdf61ebbfb24474069 (patch)
tree329e21e74fbbcc104b35cfe1539011b44369369b
parent2d1b6fc23a6d3f7e8738003247e8db1c43f31d14 (diff)
downloadaur-66609e790efbe0510e795fcdf61ebbfb24474069.tar.gz
New setting: block device autosuspend delay (30s for cut throttle; disabled for full throttle) and fix nags of backlight and runtime pm
-rwxr-xr-xthrottle17
1 files changed, 14 insertions, 3 deletions
diff --git a/throttle b/throttle
index 548694372233..247eade3293f 100755
--- a/throttle
+++ b/throttle
@@ -21,6 +21,7 @@ while (( "$#" )); do
AAM="254"
CONTROL="on"
AUTOSUSPEND="-1"
+ DISKAUTOSUSPEND="-1"
POWERSAVE="0"
CONTROLLER="N"
WLPOWERSAVE="off"
@@ -43,6 +44,7 @@ while (( "$#" )); do
AAM="128"
CONTROL="auto"
AUTOSUSPEND="1"
+ DISKAUTOSUSPEND="30000"
POWERSAVE="1"
CONTROLLER="Y"
WLPOWERSAVE="on"
@@ -97,6 +99,10 @@ while (( "$#" )); do
[[ -n "$(command -v hdparm)" ]] && \
hdparm -qB "${APM}" -qM "${AAM}" /dev/[hs]d[a-z] 2> /dev/null &
+ # Block device autosuspend
+ for i in /sys/block/*/device/power/autosuspend_delay_ms; do \
+ printf -- "${DISKAUTOSUSPEND}" > "${i}" & done &
+
# Runtime power management for devices (with exceptions for devices by VID:PID)
for i in /sys/{class/*,bus/*/devices}/*/power/control; do \
[[ "${CONTROL}" == "auto" ]] && \
@@ -242,7 +248,8 @@ while (( "$#" )); do
printf "\nEnergy Perf Bias\n" && \
x86_energy_perf_policy -r #SUID
- printf "\nBacklight\n/sys/class/backlight/\n"
+ [[ -f /sys/class/backlight/acpi_video0 ]] && \
+ printf "\nBacklight\n/sys/class/backlight/\n" && \
for i in /sys/class/backlight/acpi_video*/brightness; do \
printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/backlight/||g; s|/.*||g; N;s|\n|\t|'
@@ -263,8 +270,12 @@ while (( "$#" )); do
printf "\nHard drives\n/dev/[hs]d[a-z]\n" && \
hdparm -B -M /dev/[hs]d[a-z] 2> /dev/null | sed 'N;s|\n||g; s|/dev/||g; s|\t| |g;' #SUID
- printf "\nRuntime power management\n/sys/{class,bus}/*/{*,devices/*}/power/control\n"
- for i in /sys/{class,bus}/*/{*,devices/*}/power/control; do \
+ printf "\nBlock device autosuspend\n/sys/block/*/device/power/autosuspend_delay_ms\n"
+ for i in /sys/block/*/device/power/autosuspend_delay_ms; do \
+ printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/block/||g; s|/device/.*||g; s|/.*||g; N;s|\n|\t|'
+
+ printf "\nRuntime power management\n/sys/{class/*,bus/*/devices}/*/power/control\n"
+ for i in /sys/{class/*,bus/*/devices}/*/power/control; do \
printf " ${i}\n$(cat ${i})\n"; done | sed 's|/sys/class/||g; s|/sys/bus/||g; s|/devices||g; s|/power/control||g; N;s|\n|\t|'
printf "\nUSB Autosuspend\n/sys/bus/usb/devices/*/power/autosuspend{,_delay_ms}\n"