From b5300e25ae3be33247acc1fde819d7cf2b6e9880 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sun, 11 Dec 2011 04:18:37 +0100 Subject: [PATCH] Don't load cpufreq_ondemand if it's built-in --- autoconfig.functions | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index a0e6f17..1a3488b 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -960,14 +960,18 @@ if [ -x /etc/init.d/loadcpufreq ] ; then rm -f $LOADCPUFREQ if [ -z "$SKIP_CPU_GOVERNOR" ] ; then - einfo "Loading cpufreq_ondemand, setting ondemand governor" - RC=0 - if modprobe cpufreq_ondemand ; RC=$? ; then - for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do - echo ondemand > $file - done - fi - eend $RC + if grep -vq ondemand /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors; then + einfo "Loading cpufreq_ondemand" + modprobe cpufreq_ondemand + eend $? + fi + + einfo "Setting ondemand governor" + RC=0 + for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do + echo ondemand > $file || RC=1 + done + eend $RC fi # cpu-governor eoutdent -- 2.1.4