~ubuntu-branches/ubuntu/trusty/pm-utils/trusty-updates

« back to all changes in this revision

Viewing changes to pm/power.d/sata_alpm

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl, Michael Biebl, Martin Pitt
  • Date: 2010-07-13 16:24:27 UTC
  • mfrom: (40.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100713162427-vpmf1kkj79e715j0
[ Michael Biebl ]
* New upstream release. (Closes: #588587)
  The main improvement is that this ships some generally useful power
  management hooks by default. Note that this conflicts with similar
  packages such as laptop-mode-tools or pm-utils-powersave-policy, so you
  should not enable them and pm-utils at the same time.
  Current hooks when switching to battery:
  - [disable_wol] Disable Wake-on-LAN on ethernet cards
  - [hal-cd-polling] Disable HAL's polling of CD drives for automounting
    them. Note that this HAL functionality is already obsolete in Debian's
    current GNOME, but still being used in current KDE and XFCE desktops.
  - [harddrive] More aggressive harddrive spindown times
  - [intel-audio-powersave] Put ac97 and hda cards to sleep when inactive.
  - [journal-commit, xfs_buffer] Delay ext[34]/ext journal/metadata
    writeback
  - [laptop-mode] Delay hard disk writeback times of dirty caches, to avoid
    spin ups
  - [pcie_aspm] PCI express cards power saving
  - [readahead] More speculative readahead, at the expense of using more
    memory
  - [sata_alpm] Enable SATA link power management
  - [sched-powersave] Try to use fewer cores on multi-core machines
  - [wireless] Reduce RX/TX power when idle on some known-working drivers
    (various Intel chips for now)
* video-quirks/*
  - Update quirks to latest upstream release pm-quirks-20100619.
* Drop patches applied upstream
  - debian/patches/05-inspiron-8600-ati-quirk.patch
  - debian/patches/08-fix-lock-file-handling.patch
  - debian/patches/12-man-page-fixes.patch
* Refresh and update all patches so they apply cleanly.
* debian/control
  - Demote radeontool to Suggests. The standard Debian/Ubuntu kernels use
    KMS for radeon which makes this tool obsolete. (Closes: #588768)

[ Martin Pitt ]
* debian/control: Add hdparm Recommends and ethtool/wireless-tools Suggests,
  for the newly added power saving hooks.
* debian/control: Conflicts/Replaces: pm-utils-powersave-policy, superseded
  by the now integrated power.d hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
. "${PM_FUNCTIONS}"
 
4
 
 
5
SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true}
 
6
 
 
7
help() {
 
8
cat <<EOF
 
9
$0: SATA link power management
 
10
 
 
11
This hook tries to save power by allowing SATA controllers to
 
12
reduce power usage when the SATA subsystem is otherwise idle.
 
13
 
 
14
This adds a little bit of latency to drive accesses in
 
15
exchange for moderate power savings if you are not using the drive.
 
16
 
 
17
This hook has 1 parameter:
 
18
SATA_ALPM_ENABLE = whether to use SATA ALPM on battery.
 
19
Defaults to "true".
 
20
 
 
21
EOF
 
22
}
 
23
 
 
24
set_sata_alpm() {
 
25
    # see kernel commit 6013efd8860bf15c1f86f365332642cfe557152f
 
26
    kv="$(uname -r)"
 
27
    [ "$kv" ] || exit $NA  #for paranoia's sake
 
28
    [ "${kv%-*}" \< "2.6.33" ] && exit $NA  # avoid fs corruption
 
29
    for f in /sys/class/scsi_host/host*; do
 
30
        [ -w "$f/link_power_management_policy" ] || continue
 
31
        printf "Setting SATA APLM on %s to %s..." "${f##*/}" "$1"
 
32
        echo "$1" > "$f/link_power_management_policy" && echo Done. || \
 
33
            echo Failed.
 
34
    done
 
35
}
 
36
 
 
37
case $1 in
 
38
    true) [ "$SATA_ALPM_ENABLE" = true ] && set_sata_alpm min_power;;
 
39
    false) set_sata_alpm max_performance;;
 
40
    help) help;;
 
41
    *) exit $NA;;
 
42
esac
 
43
 
 
44
exit 0
 
 
b'\\ No newline at end of file'