| 1 |
#! /bin/sh |
| 2 |
# |
| 3 |
# Laptop mode tools module: PCIe Active State Power Management |
| 4 |
# |
| 5 |
|
| 6 |
if [ x$CONTROL_PCIE_ASPM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_PCIE_ASPM = xauto ]; then |
| 7 |
if [ $ON_AC -eq 1 ]; then |
| 8 |
log "VERBOSE" "On AC power: setting pcie_aspm to default" |
| 9 |
if [ -f /sys/module/pcie_aspm/parameters/policy ]; then |
| 10 |
echo default > /sys/module/pcie_aspm/parameters/policy 2>/dev/null |
| 11 |
if [ $? -eq 0 ]; then |
| 12 |
log "VERBOSE" "PCIe ASPM set to 'default'" |
| 13 |
else |
| 14 |
log "VERBOSE" "PCIe ASPM tweaking is prohibited by the kernel" |
| 15 |
fi |
| 16 |
else |
| 17 |
log "VERBOSE" "PCIe ASPM is not available" |
| 18 |
fi |
| 19 |
else |
| 20 |
log "VERBOSE" "On battery: setting pcie_aspm to powersave" |
| 21 |
if [ -f /sys/module/pcie_aspm/parameters/policy ]; then |
| 22 |
echo powersave > /sys/module/pcie_aspm/parameters/policy 2>/dev/null |
| 23 |
if [ $? -eq 0 ]; then |
| 24 |
log "VERBOSE" "PCIe ASPM set to 'powersave'" |
| 25 |
else |
| 26 |
log "VERBOSE" "PCIe ASPM tweaking is prohibited by the kernel" |
| 27 |
fi |
| 28 |
else |
| 29 |
log "VERBOSE" "PCIe ASPM is not available" |
| 30 |
fi |
| 31 |
fi |
| 32 |
else |
| 33 |
log "VERBOSE" "PCIe ASPM power savings module is disabled" |
| 34 |
fi |
| 35 |
|