--- cpuspeed.cc.patchfc2 2004-10-25 17:48:28.000000000 -0700 +++ cpuspeed.cc.mattes 2004-10-25 19:07:32.000000000 -0700 @@ -36,15 +36,20 @@ #include #include +// for printk +#include + #ifndef NAME # 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 +378,18 @@ 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); + syslog(LOG_WARNING, "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) {