Bug 137146 - no cpu speedstep after suspend
no cpu speedstep after suspend
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: kernel-utils (Show other bugs)
2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-26 02:18 EDT by Matthias Kattanek
Modified: 2015-01-04 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-04 09:28:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthias Kattanek 2004-10-26 02:18:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
CPU speed does not speedstep anylonger after resuming from suspend mode.
Often you see the message "Warning: CPU frequency out of sync:"

The problem is in the binary /usr/sbin/cpuspeed itself. (using FC2).
After suspend the CPU is set highest/fastest speed. Cpuspeed does not
know about suspend and never checks the real CPU speed. It always
assumes the speed from memory. In case the switching threshold is never
reached, your battery will soon be empty.

They is most likeley a more elegant way to do this (lack of knowledge
;-)) ), though this one (modified alarm_hanlder()) works fine for me:

# diff -u cpuspeed.cc.patchfc2 cpuspeed.cc
--- cpuspeed.cc.patchfc2        2004-10-25 17:48:28.000000000 -0700 +++
cpuspeed.cc 2004-10-25 19:36:04.851315688 -0700
@@ -40,11 +40,13 @@
 #  define NAME "cpuspeed"
 #endif

-#define VERSION "1.1"
+#define VERSION "1.1m"

 // Maximum number of speed steps.  Must be 2 or greater
 #define MAX_SPEEDS  20

+#define DEBUG
+
 // To activate debug printings
 #ifdef DEBUG
 #   define errprintf(A...) fprintf(stderr,A)
@@ -373,6 +375,16 @@
             break;
     }

+    // does current speed equals 'real' speed
+    //   this case only applies after suspend
+    // if ( # diff -u cpuspeed.cc.patchfc2 cpuspeed.cc
--- cpuspeed.cc.patchfc2        2004-10-25 17:48:28.000000000 -0700 +++
cpuspeed.cc 2004-10-25 19:36:04.851315688 -0700
@@ -40,11 +40,13 @@
 #  define NAME "cpuspeed"
 #endif

-#define VERSION "1.1"
+#define VERSION "1.1m"

 // Maximum number of speed steps.  Must be 2 or greater
 #define MAX_SPEEDS  20

+#define DEBUG
+
 // To activate debug printings
 #ifdef DEBUG
 #   define errprintf(A...) fprintf(stderr,A)
@@ -373,6 +375,16 @@
             break;
     }

+    // does current speed equals 'real' speed
+    //   this case only applies after suspend
+    // if ( we had suspend )  how do we check??
+    unsigned int is_speed = get_speed();
+    if ( speeds[current_speed].khz != is_speed ) {
+       errprintf("real-CPU-SPEED %4dKHz vs think-SPEED %4dkhz\n", +
       is_speed, speeds[current_speed].khz);
+       new_speed = 0;
+       current_speed = 1;
+    }
     // if the last set speed is not what it currently should be, set it
if (current_speed != new_speed)
     {we had suspend )  how do we check??
+    unsigned int is_speed = get_speed();
+    if ( speeds[current_speed].khz != is_speed ) {
+       errprintf("real-CPU-SPEED %4dKHz vs think-SPEED %4dkhz\n", +
       is_speed, speeds[current_speed].khz);
+       new_speed = 0;
+       current_speed = 1;
+    }
     // if the last set speed is not what it currently should be, set it
if (current_speed != new_speed)
     {
#end of diff


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. use Pentium M (centrino) w. speedstep technology
2. monitor '/cat /proc/cpuinfo', wait until lowest cpu freq is  
operating.
 suspend OS 'echo 3 > /proc/acpi/sleep' 
3. resume from suspend
4. check '/cat /proc/cpuinfo', you will notice CPU freq will go lower
   (unless you put a high load on machine ;-)) 

    

Actual Results:  CPU will stay high

Expected Results:  cpuspeed should speedstep CPU

Additional info:

system log will show message "Warning: CPU frequency out of sync:"
Comment 1 Matthew Miller 2005-04-26 11:13:15 EDT
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 2 John Thacker 2006-05-04 09:28:41 EDT
Closing per previous comment.

Note You need to log in before you can comment on or make changes to this bug.