[packages/laptop-mode-tools] - WIP patch to add support for SATA ALPM

baggins baggins at pld-linux.org
Sat Mar 4 10:18:49 CET 2017


commit f893c9f4cbeb6b50641c6afd6f4234920418695c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Mar 4 10:18:29 2017 +0100

    - WIP patch to add support for SATA ALPM

 sata-alpm.patch | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)
---
diff --git a/sata-alpm.patch b/sata-alpm.patch
new file mode 100644
index 0000000..4a58d1a
--- /dev/null
+++ b/sata-alpm.patch
@@ -0,0 +1,89 @@
+--- /dev/null	2017-02-28 21:16:52.000000000 +0100
++++ laptop-mode-tools-1.71/usr/share/laptop-mode-tools/modules/sata-alpm	2017-03-04 10:16:55.823426823 +0100
+@@ -0,0 +1,26 @@
++#!/bin/sh
++#
++# SATA link power management
++
++if [ "$KLEVEL" = "2.6" -a "$KMINOR" -lt 33 ] ; then
++	log "VERBOSE" "Changing SATA link power management may cause filesystem corruption on kernels before 2.6.33. Disabling."
++	CONTROL_SATA_ALPM=0
++fi
++
++if [ x$CONTROL_SATA_ALPM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SATA_ALPM = xauto ]; then
++	if [ $ON_AC -eq 1 ] ; then
++		if [ "$ACTIVATE" -eq 1 ] ; then
++			SATA_LINK_POLICY="$LM_AC_SATA_LINK_POLICY"
++		else
++			SATA_LINK_POLICY="$NOLM_AC_SATA_LINK_POLICY"
++		fi
++	else
++		SATA_LINK_POLICY="$BATT_SATA_LINK_POLICY"
++	fi
++	for SATAHOST in /sys/class/scsi_host/host*; do
++		if [ -w "$SATAHOST/link_power_management_policy" ]; then
++			log "VERBOSE" "Setting SATA APLM on $SATAHOST to $SATA_LINK_POLICY."
++			echo "$SATA_LINK_POLICY" > "$SATAHOST/link_power_management_policy"
++		fi
++	done
++fi
+--- /dev/null	2017-02-28 21:16:52.000000000 +0100
++++ laptop-mode-tools-1.71/etc/laptop-mode/conf.d/sata-alpm.conf	2017-03-04 10:16:16.082421957 +0100
+@@ -0,0 +1,57 @@
++#
++# Configuration file for Laptop Mode Tools module sata-alpm.
++#
++# For more information, consult the laptop-mode.conf(8) manual page.
++#
++
++###############################################################################
++# SATA link power management
++# ------------------------------------
++#
++#__COMMENT Laptop mode tools can automatically adjust SATA link power management policy
++#__COMMENT setting.
++#__COMMENT
++#__COMMENT This hook tries to save power by allowing SATA controllers to
++#__COMMENT reduce power usage when the SATA subsystem is otherwise idle.
++#__COMMEN
++#__COMMENT This adds a little bit of latency to drive accesses in
++#__COMMENT exchange for moderate power savings if you are not using the drive.
++#__COMMENT
++#__COMMENT see kernel commit 6013efd8860bf15c1f86f365332642cfe557152f
++#__COMMENT
++#__COMMENT This feature only works on 2.6.33+ kernels.
++###############################################################################
++
++# Enable debug mode for this module
++# Set to 1 if you want to debug this module
++DEBUG=0
++
++#
++# Should laptop mode tools control SATA link power settings?
++#
++# Set to 0 to disable
++SATA_ALPM_FREQUENCY="auto"
++
++
++#
++# This parameter allows the user to set the link (interface) power management.
++# There are 3 possible options:
++#
++# Value                 Effect
++# ----------------------------------------------------------------------------
++# min_power             Tell the controller to try to make the link use the
++#                       least possible power when possible.  This may
++#                       sacrifice some performance due to increased latency
++#                       when coming out of lower power states.
++#
++# max_performance       Generally, this means no power management.  Tell
++#                       the controller to have performance be a priority
++#                       over power management.
++#
++# medium_power          Tell the controller to enter a lower power state
++#                       when possible, but do not enter the lowest power
++#                       state, thus improving latency over min_power setting.
++#
++BATT_SATA_LINK_POLICY=min_power
++LM_AC_SATA_LINK_POLICY=max_performance
++NOLM_AC_SATA_LINK_POLICY=max_performance
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/laptop-mode-tools.git/commitdiff/f893c9f4cbeb6b50641c6afd6f4234920418695c



More information about the pld-cvs-commit mailing list