summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2007-03-14 15:37:04 +0000
committerPeter Jones <pjones@redhat.com>2007-03-14 15:37:04 +0000
commit264aea5efe616901dcf8183d428ae4a43d9b2a5a (patch)
tree7009b9e6637f45d14869c5f54d2e481add0ab85f /pm
parent7c8e24b2fd81d77f1bf6a622eb2471c0e0f2d807 (diff)
- Fix cpufreq save/restore on multi-core cpus
Diffstat (limited to 'pm')
-rw-r--r--pm/defaults3
-rwxr-xr-xpm/functions2
-rwxr-xr-xpm/hooks/94cpufreq12
3 files changed, 14 insertions, 3 deletions
diff --git a/pm/defaults b/pm/defaults
index 6c85dde..d5b6447 100644
--- a/pm/defaults
+++ b/pm/defaults
@@ -3,6 +3,7 @@
# DO NOT EDIT THIS FILE, edit /etc/pm/config.d/ instead! #
##########################################################
+HIBERNATE_RESUME_POST_VIDEO="no"
+
SUSPEND_MODULES=""
-HIBERNATE_RESUME_POST_VIDEO="no"
diff --git a/pm/functions b/pm/functions
index 2f965d4..34a0794 100755
--- a/pm/functions
+++ b/pm/functions
@@ -12,6 +12,7 @@ HIBERNATE_RESUME_POST_VIDEO=no
INHIBIT=/var/run/pm-utils.inhibit
PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log}
SUSPEND_MODULES=""
+TEMPORARY_CPUFREQ_GOVERNOR="userspace"
[ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
@@ -28,6 +29,7 @@ add_global PM_LOGFILE
add_global PM_CMDLINE
add_global RESUME_MODULES
add_global SUSPEND_MODULES
+add_global TEMPORARY_CPUFREQ_GOVERNOR
source_configs()
{
diff --git a/pm/hooks/94cpufreq b/pm/hooks/94cpufreq
index f932af7..011ef55 100755
--- a/pm/hooks/94cpufreq
+++ b/pm/hooks/94cpufreq
@@ -11,7 +11,15 @@ hibernate_cpufreq()
[ -f $x/cpufreq/scaling_governor ] || continue
savestate ${x}_governor $(cat $x/cpufreq/scaling_governor)
- sh -c "echo userspace > $x/cpufreq/scaling_governor" >/dev/null 2>&1
+ done
+ for x in $(ls -1) ; do
+ [ -d $x/cpufreq ] || continue
+ [ -f $x/cpufreq/scaling_governor ] || continue
+
+ gov="$TEMPORARY_CPUFREQ_GOVERNOR"
+ grep -q "$GOVERNOR" $x/cpufreq/scaling_available_governors \
+ || gov="userspace"
+ sh -c "echo \"$gov\" > $x/cpufreq/scaling_governor"
done
popd >/dev/null 2>&1
}
@@ -23,7 +31,7 @@ thaw_cpufreq()
gov=$(restorestate $(echo cpu${x}_governor))
[ -z "$gov" ] && break
- sh -c "echo \"$gov\" > /sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor" >/dev/null 2>&1
+ sh -c "echo \"$gov\" > /sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor"
unset gov
x=$(($x + 1))
done