diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2011-04-21 15:03:19 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2011-04-21 15:03:19 +0000 |
commit | 1904d98b93b985657ab9237fcc632b6b3b27b074 (patch) | |
tree | 264e996b2d5dab95539f78a8b00158715365349e /sys-power/pm-utils | |
parent | QA: fix header line. (diff) | |
download | gentoo-2-1904d98b93b985657ab9237fcc632b6b3b27b074.tar.gz gentoo-2-1904d98b93b985657ab9237fcc632b6b3b27b074.tar.bz2 gentoo-2-1904d98b93b985657ab9237fcc632b6b3b27b074.zip |
Backport some patches to fix issues with bluetooth/sata/... Per bug #336654.
(Portage version: 2.2.0_alpha30/cvs/Linux x86_64)
Diffstat (limited to 'sys-power/pm-utils')
-rw-r--r-- | sys-power/pm-utils/ChangeLog | 12 | ||||
-rw-r--r-- | sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch | 43 | ||||
-rw-r--r-- | sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch | 26 | ||||
-rw-r--r-- | sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch | 40 | ||||
-rw-r--r-- | sys-power/pm-utils/files/1.4.1-logging-append.patch | 19 | ||||
-rw-r--r-- | sys-power/pm-utils/pm-utils-1.4.1-r2.ebuild (renamed from sys-power/pm-utils/pm-utils-1.4.1-r1.ebuild) | 32 |
6 files changed, 156 insertions, 16 deletions
diff --git a/sys-power/pm-utils/ChangeLog b/sys-power/pm-utils/ChangeLog index 980b83d68a4f..66ffa08cc8ab 100644 --- a/sys-power/pm-utils/ChangeLog +++ b/sys-power/pm-utils/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-power/pm-utils -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/pm-utils/ChangeLog,v 1.57 2010/12/12 16:50:12 armin76 Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/pm-utils/ChangeLog,v 1.58 2011/04/21 15:03:19 scarabeus Exp $ + +*pm-utils-1.4.1-r2 (21 Apr 2011) + + 21 Apr 2011; Tomáš Chvátal <scarabeus@gentoo.org> + +files/1.4.1-bluetooth-sync.patch, +files/1.4.1-disable-sata-alpm.patch, + +files/1.4.1-fix-intel-audio-powersave-hook.patch, -pm-utils-1.4.1-r1.ebuild, + +files/1.4.1-logging-append.patch, +pm-utils-1.4.1-r2.ebuild: + Backport some patches to fix issues with bluetooth/sata/... Per bug #336654. 12 Dec 2010; Raúl Porcel <armin76@gentoo.org> pm-utils-1.4.1.ebuild, pm-utils-1.4.1-r1.ebuild: diff --git a/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch b/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch new file mode 100644 index 000000000000..b41f32cf9165 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch @@ -0,0 +1,43 @@ +From 640b53438c20818b3e344343b58b1f1765606a85 Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martin.pitt@ubuntu.com> +Date: Mon, 31 Jan 2011 15:30:01 +0100 +Subject: [PATCH] 49bluetooth: Wait for btusb module to get unused + +The 49bluetooth hook disables /proc/acpi/ibm/bluetooth but this isn't +synchronous, i. e. it doesn't wait until the module usage count actually drops +to 0. Due to that, it's impossible to add btusb to SUSPEND_MODULES (on some +models/older kernels you need to do that to fix suspend problems), as at that +point the module is still in use. + +On my system (ThinkPad X201) the module takes between 0.3 and 0.5 seconds to +unload, so use 100 ms wait steps with a timeout of 2 seconds. + +Bug: https://bugs.freedesktop.org//show_bug.cgi?id=33759 +Bug-Ubuntu: https://launchpad.net/bugs/698331 +--- + pm/sleep.d/49bluetooth | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/pm/sleep.d/49bluetooth b/pm/sleep.d/49bluetooth +index d46ba49..0dc1909 100755 +--- a/pm/sleep.d/49bluetooth ++++ b/pm/sleep.d/49bluetooth +@@ -12,6 +12,15 @@ suspend_bluetooth() + if grep -q enabled /proc/acpi/ibm/bluetooth; then + savestate ibm_bluetooth enable + echo disable > /proc/acpi/ibm/bluetooth ++ ++ # wait for up to 2 seconds for the module to actually get ++ # unused ++ TIMEOUT=20 ++ while [ $TIMEOUT -ge 0 ]; do ++ [ `cat /sys/module/btusb/refcnt` = 0 ] && break ++ TIMEOUT=$((TIMEOUT-1)) ++ sleep 0.1 ++ done + else + savestate ibm_bluetooth disable + fi +-- +1.7.2.3 + diff --git a/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch b/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch new file mode 100644 index 000000000000..7b5494932c95 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch @@ -0,0 +1,26 @@ +Description: Disable SATA link power management by default, as it still causes disk errors and corruptions on many hardware. +Author: Martin Pitt <martin.pitt@ubuntu.com> +Bug-Ubuntu: https://launchpad.net/bugs/539467 + +Index: pm-utils/pm/power.d/sata_alpm +=================================================================== +--- pm-utils.orig/pm/power.d/sata_alpm 2011-02-01 15:53:09.164867778 +0100 ++++ pm-utils/pm/power.d/sata_alpm 2011-02-01 15:53:28.954867786 +0100 +@@ -2,7 +2,7 @@ + + . "${PM_FUNCTIONS}" + +-SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true} ++SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-false} + + help() { + cat <<EOF +@@ -16,7 +16,7 @@ + + This hook has 1 parameter: + SATA_ALPM_ENABLE = whether to use SATA ALPM on battery. +-Defaults to "true". ++Defaults to "false". + + EOF + } diff --git a/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch b/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch new file mode 100644 index 000000000000..2d884da1e7b6 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch @@ -0,0 +1,40 @@ +From: Florian Kriener <florian@kriener.org> +To: submit@bugs.debian.org +Subject: [pm-utils] wrong path in intel-audio-powersave (and a small bug) +Date: Sat, 25 Sep 2010 11:27:30 +0200 + +In the script intel-audio-powersave is this loop + +for dev in /sys/module/snd_*/parameters/power_save; do + [ -w "$dev/parameters/power_save" ] || continue + printf "Setting power savings for $s to %d..." "$dev##*/" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. +done + +I think it should be + +for dev in /sys/module/snd_*; do + [ -w "$dev/parameters/power_save" ] || continue + printf "Setting power savings for %s to %d..." "${dev##*/}" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. +done + + +This fixes the two bugs. + +diff --git a/pm/power.d/intel-audio-powersave b/pm/power.d/intel-audio-powersave +index 36675a8..da63e40 100644 +--- a/pm/power.d/intel-audio-powersave ++++ b/pm/power.d/intel-audio-powersave +@@ -20,9 +20,9 @@ EOF + + audio_powersave() { + [ "$INTEL_AUDIO_POWERSAVE" = "true" ] || exit $NA +- for dev in /sys/module/snd_*/parameters/power_save; do ++ for dev in /sys/module/snd_*; do + [ -w "$dev/parameters/power_save" ] || continue +- printf "Setting power savings for $s to %d..." "$dev##*/" "$1" ++ printf "Setting power savings for %s to %d..." "${dev##*/}" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. + done + } diff --git a/sys-power/pm-utils/files/1.4.1-logging-append.patch b/sys-power/pm-utils/files/1.4.1-logging-append.patch new file mode 100644 index 000000000000..987e0570a9c1 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-logging-append.patch @@ -0,0 +1,19 @@ +Author: James Westby <james.westby@ubuntu.com> +Description: Do not clear the log file on each operation, but instead append to it. + This makes debugging of several suspends much easier. +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25255 +Bug-Ubuntu: https://launchpad.net/bugs/410352 + +Index: pm-utils/pm/pm-functions.in +=================================================================== +--- pm-utils.orig/pm/pm-functions.in 2010-07-05 18:41:21.118322244 +0200 ++++ pm-utils/pm/pm-functions.in 2010-07-05 18:41:24.126325221 +0200 +@@ -271,7 +271,7 @@ + return 1 + fi + export LOGGING=true +- exec > "$1" 2>&1 ++ exec >> "$1" 2>&1 + } + + check_suspend() { [ -n "$SUSPEND_MODULE" ]; } diff --git a/sys-power/pm-utils/pm-utils-1.4.1-r1.ebuild b/sys-power/pm-utils/pm-utils-1.4.1-r2.ebuild index 595b6ce5542c..4e2c9c747197 100644 --- a/sys-power/pm-utils/pm-utils-1.4.1-r1.ebuild +++ b/sys-power/pm-utils/pm-utils-1.4.1-r2.ebuild @@ -1,9 +1,10 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/pm-utils/pm-utils-1.4.1-r1.ebuild,v 1.3 2010/12/12 16:50:12 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/pm-utils/pm-utils-1.4.1-r2.ebuild,v 1.1 2011/04/21 15:03:19 scarabeus Exp $ -EAPI=2 -inherit multilib +EAPI=4 + +inherit eutils DESCRIPTION="Suspend and hibernation utilities" HOMEPAGE="http://pm-utils.freedesktop.org/" @@ -15,10 +16,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" IUSE="alsa debug ntp video_cards_intel video_cards_radeon" vbetool="!video_cards_intel? ( sys-apps/vbetool )" -DEPEND="!<app-laptop/laptop-mode-tools-1.55-r1 - !<sys-power/powermgmt-base-1.31 - !>=sys-power/powermgmt-base-1.31[-pm-utils]" -RDEPEND="${DEPEND} +RDEPEND="!<app-laptop/laptop-mode-tools-1.55-r1 + !sys-power/powermgmt-base[-pm-utils(+)] sys-apps/dbus >=sys-apps/util-linux-2.13 sys-power/pm-quirks @@ -27,6 +26,7 @@ RDEPEND="${DEPEND} amd64? ( ${vbetool} ) x86? ( ${vbetool} ) video_cards_radeon? ( app-laptop/radeontool )" +DEPEND="${RDEPEND}" src_prepare() { local ignore="01grub" @@ -34,22 +34,26 @@ src_prepare() { use debug && echo 'PM_DEBUG="true"' > "${T}"/gentoo echo "HOOK_BLACKLIST=\"${ignore}\"" >> "${T}"/gentoo + + epatch "${FILESDIR}"/${PV}-bluetooth-sync.patch \ + "${FILESDIR}"/${PV}-disable-sata-alpm.patch \ + "${FILESDIR}"/${PV}-fix-intel-audio-powersave-hook.patch \ + "${FILESDIR}"/${PV}-logging-append.patch + } src_configure() { econf \ - --docdir=/usr/share/doc/${PF} \ - --disable-dependency-tracking \ --disable-doc } src_install() { - emake DESTDIR="${D}" install || die - dodoc AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO || die - doman man/*.{1,8} || die + emake DESTDIR="${D}" install + dodoc AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO + doman man/*.{1,8} insinto /etc/pm/config.d - doins "${T}"/gentoo || die + doins "${T}"/gentoo # NetworkManager 0.8.2 is handling suspend/resume on it's own with UPower find "${D}" -type f -name 55NetworkManager -exec rm -f '{}' + |