rpms/cpuspeed/FC-5 cpuspeed.init,1.8,1.9 cpuspeed.spec,1.33,1.34

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sun Nov 12 05:57:04 UTC 2006


Author: davej

Update of /cvs/dist/rpms/cpuspeed/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv29451

Modified Files:
	cpuspeed.init cpuspeed.spec 
Log Message:
- Fix up 'FATAL: Error inserting acpi_cpufreq' problem. (#212031)
- Load ondemand governor instead of userspace for centrino.



Index: cpuspeed.init
===================================================================
RCS file: /cvs/dist/rpms/cpuspeed/FC-5/cpuspeed.init,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cpuspeed.init	24 Feb 2006 03:20:56 -0000	1.8
+++ cpuspeed.init	12 Nov 2006 05:57:02 -0000	1.9
@@ -27,13 +27,19 @@
 			if [ -n "$DRIVER" ]; then
 				/sbin/modprobe "$DRIVER"
 			else
-				# use ACPI as a fallback if its available.
-				if [ -f /proc/acpi/processor/CPU0/throttling ]; then
-					# Check we have throttling states available.
-					thr=`head -n1 -q /proc/acpi/processor/CPU*/throttling | uniq`
-					if [ "$thr" != "<not supported>" ]; then
+				if [ -d /proc/acpi ]; then
+					EST=`grep flags /proc/cpuinfo | grep est`
+					if [ "$EST" ]; then
+						# use ACPI as a fallback
 						/sbin/modprobe acpi-cpufreq
+						# even ACPI didn't work, remove it, and bail out.
+						if [ -d /sys/devices/system/cpu/cpu0/cpufreq ]; then
+							/sbin/rmmod acpi-cpufreq
+						fi
 					fi
+				else
+					# This is a no-ACPI machine. Just exit.
+					return 0
 				fi
 			fi
 		done
@@ -41,12 +47,24 @@
 		# If we get this far with no driver, we must have no ACPI. We're doomed.
 		[ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ] && return 0
 
-		echo -n $"Starting $prog: "
+		drv=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver)
 
-		daemon cpuspeed -d $OPTS
-		RETVAL=$?
-		echo
-		[ $RETVAL = 0 ] && touch /var/lock/subsys/cpuspeed
+		case "$drv" in
+		centrino|powernow-k8)
+			/sbin/modprobe cpufreq-ondemand
+			for i in /sys/devices/system/cpu/cpu*
+			do
+				echo ondemand > $i/cpufreq/scaling_governor
+			done
+			RETVAL=0
+			;;
+		*)
+			echo -n $"Starting $prog: "
+			daemon cpuspeed -d $OPTS
+			RETVAL=$?
+			echo
+			[ $RETVAL = 0 ] && touch /var/lock/subsys/cpuspeed
+		esac
 	else
 		return 0
 	fi
@@ -54,17 +72,26 @@
 }
 
 stop() {
-	if test "x`pidof cpuspeed`" != x; then
-		echo -n $"Stopping $prog: "
-		killproc cpuspeed -USR1
-		killproc cpuspeed -INT
-		echo
-	fi
-	if test "x`pidof cpuspeed`" != x; then
-		killproc cpuspeed
-	fi
-	RETVAL=$?
-	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/cpuspeed
+	drv=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver)
+	case "$drv" in
+	centrino|powernow-k8)
+		/sbin/rmmod cpufreq-ondemand
+		RETVAL=0
+		;;
+	*)
+		if test "x`pidof cpuspeed`" != x; then
+			echo -n $"Stopping $prog: "
+			killproc cpuspeed -USR1
+			killproc cpuspeed -INT
+			echo
+		fi
+		if test "x`pidof cpuspeed`" != x; then
+			killproc cpuspeed
+		fi
+		RETVAL=$?
+		[ $RETVAL = 0 ] && rm -f /var/lock/subsys/cpuspeed
+	esac
+
 	return $RETVAL
 }
 
@@ -72,11 +99,11 @@
 	start)
 	    start
 	    ;;
-	
+
 	stop)
 	    stop
 	    ;;
-	
+
 	status)
 	    status cpuspeed
 	    ;;
@@ -90,7 +117,7 @@
 		start
 	    fi
 	    ;;
-	
+
 	*)
 	    echo $"Usage: $0 {start|stop|restart|condrestart|status}"
 	    exit 1


Index: cpuspeed.spec
===================================================================
RCS file: /cvs/dist/rpms/cpuspeed/FC-5/cpuspeed.spec,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- cpuspeed.spec	24 Feb 2006 03:20:56 -0000	1.33
+++ cpuspeed.spec	12 Nov 2006 05:57:02 -0000	1.34
@@ -72,6 +72,10 @@
 exit 0
 
 %changelog
+* Sun Nov 12 2006 Dave Jones <davej at redhat.com>
+- Fix up 'FATAL: Error inserting acpi_cpufreq' problem. (#212031)
+- Load ondemand governor instead of userspace for centrino.
+
 * Thu Feb 23 2006 Dave Jones <davej at redhat.com>
 - Fix broken init script. (Alexandre Oliva) [#182691]
   Taking ugly shell script to the next level.




More information about the fedora-cvs-commits mailing list