]> git.pld-linux.org Git - packages/laptop-mode-tools.git/blame - sata-alpm.patch
- WIP patch to add support for SATA ALPM
[packages/laptop-mode-tools.git] / sata-alpm.patch
CommitLineData
f893c9f4
JR
1--- /dev/null 2017-02-28 21:16:52.000000000 +0100
2+++ laptop-mode-tools-1.71/usr/share/laptop-mode-tools/modules/sata-alpm 2017-03-04 10:16:55.823426823 +0100
3@@ -0,0 +1,26 @@
4+#!/bin/sh
5+#
6+# SATA link power management
7+
8+if [ "$KLEVEL" = "2.6" -a "$KMINOR" -lt 33 ] ; then
9+ log "VERBOSE" "Changing SATA link power management may cause filesystem corruption on kernels before 2.6.33. Disabling."
10+ CONTROL_SATA_ALPM=0
11+fi
12+
13+if [ x$CONTROL_SATA_ALPM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SATA_ALPM = xauto ]; then
14+ if [ $ON_AC -eq 1 ] ; then
15+ if [ "$ACTIVATE" -eq 1 ] ; then
16+ SATA_LINK_POLICY="$LM_AC_SATA_LINK_POLICY"
17+ else
18+ SATA_LINK_POLICY="$NOLM_AC_SATA_LINK_POLICY"
19+ fi
20+ else
21+ SATA_LINK_POLICY="$BATT_SATA_LINK_POLICY"
22+ fi
23+ for SATAHOST in /sys/class/scsi_host/host*; do
24+ if [ -w "$SATAHOST/link_power_management_policy" ]; then
25+ log "VERBOSE" "Setting SATA APLM on $SATAHOST to $SATA_LINK_POLICY."
26+ echo "$SATA_LINK_POLICY" > "$SATAHOST/link_power_management_policy"
27+ fi
28+ done
29+fi
30--- /dev/null 2017-02-28 21:16:52.000000000 +0100
31+++ laptop-mode-tools-1.71/etc/laptop-mode/conf.d/sata-alpm.conf 2017-03-04 10:16:16.082421957 +0100
32@@ -0,0 +1,57 @@
33+#
34+# Configuration file for Laptop Mode Tools module sata-alpm.
35+#
36+# For more information, consult the laptop-mode.conf(8) manual page.
37+#
38+
39+###############################################################################
40+# SATA link power management
41+# ------------------------------------
42+#
43+#__COMMENT Laptop mode tools can automatically adjust SATA link power management policy
44+#__COMMENT setting.
45+#__COMMENT
46+#__COMMENT This hook tries to save power by allowing SATA controllers to
47+#__COMMENT reduce power usage when the SATA subsystem is otherwise idle.
48+#__COMMEN
49+#__COMMENT This adds a little bit of latency to drive accesses in
50+#__COMMENT exchange for moderate power savings if you are not using the drive.
51+#__COMMENT
52+#__COMMENT see kernel commit 6013efd8860bf15c1f86f365332642cfe557152f
53+#__COMMENT
54+#__COMMENT This feature only works on 2.6.33+ kernels.
55+###############################################################################
56+
57+# Enable debug mode for this module
58+# Set to 1 if you want to debug this module
59+DEBUG=0
60+
61+#
62+# Should laptop mode tools control SATA link power settings?
63+#
64+# Set to 0 to disable
65+SATA_ALPM_FREQUENCY="auto"
66+
67+
68+#
69+# This parameter allows the user to set the link (interface) power management.
70+# There are 3 possible options:
71+#
72+# Value Effect
73+# ----------------------------------------------------------------------------
74+# min_power Tell the controller to try to make the link use the
75+# least possible power when possible. This may
76+# sacrifice some performance due to increased latency
77+# when coming out of lower power states.
78+#
79+# max_performance Generally, this means no power management. Tell
80+# the controller to have performance be a priority
81+# over power management.
82+#
83+# medium_power Tell the controller to enter a lower power state
84+# when possible, but do not enter the lowest power
85+# state, thus improving latency over min_power setting.
86+#
87+BATT_SATA_LINK_POLICY=min_power
88+LM_AC_SATA_LINK_POLICY=max_performance
89+NOLM_AC_SATA_LINK_POLICY=max_performance
This page took 0.031895 seconds and 4 git commands to generate.