On Sat, 2005-05-07 at 23:42 -0400, John Clemens wrote:
> Thanks for the info.. Well, all those number look right.. this is just 
> getting bizarre.
> 
> I'm attaching a new powernowd.c file.. it has some extra debugging turned 
> on.. would you mind running it?  just compile it (gcc -o powernowd 
> powernowd.c) and run it as root.. no need for special flags or anything. 


Well, what do you know, your new version works. I downloaded debian's 0.95 
source and compared it to your version, and isolated the change that made 
it work:


--- powernowd_0.95.c 2005-05-08 06:08:58.000000000 +0200
+++ powernowd.c 2005-05-08 06:19:48.000000000 +0200
@@ -416,7 +416,7 @@
        strncpy(scratch, cpu->sysfs_dir, 50);
        strncat(scratch, "scaling_available_frequencies", 50);

-       if (((err = read_file(scratch, 0, 1)) < 0) || (step_specified)) {
+       if (((err = read_file(scratch, 0, 1)) != 0) || (step_specified)) {
                /*
                 * We don't have scaling_available_frequencies. build the
                 * table from the min, max, and step values.  the driver


The whole section calculating the table size was simply skipped. 


> Sorry to trouble you with this, but i can't seem to figure out what's 
> wrong :/

No trouble, after all, you're taking the time to fix my problem ;-)

For completeness sake, here's the output of your version (0.96) with 
and without this patch reverted:


--- BAD

ibook:/usr/src# ./powernowd -d -vvv
PowerNow Daemon v0.96, (c) 2003-2005 John Clemens
Settings:
  verbosity:        3
  mode:             1     (AGGRESSIVE)
  step:           100 MHz (100000 kHz)
  lowwater:        20 %
  highwater:       80 %
  poll interval: 1000 ms
Found 1 cpu:  -- 1 thread (or core) per physical cpu
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such 
file or directory
  cpu0: 606Mhz - 798Mhz (1 steps)
     step1 : 606Mhz
Setting speed to 606000
Setting speed to 606000
Statistics:
  2 speed changes in 8 seconds
PowerNow Daemon Exiting.


--- GOOD

ibook:/usr/src# ./powernowd -d -vvv
PowerNow Daemon v0.96, (c) 2003-2005 John Clemens
Settings:
  verbosity:        3
  mode:             1     (AGGRESSIVE)
  step:           100 MHz (100000 kHz)
  lowwater:        20 %
  highwater:       80 %
  poll interval: 1000 ms
Found 1 cpu:  -- 1 thread (or core) per physical cpu
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such 
file or directory
max_speed = 798720, min_speed = 606000, step = 100000
1: cpu->table_size = 2
2: cpu->table_size = 3
  cpu0: 606Mhz - 798Mhz (3 steps)
     step1 : 798Mhz
     step2 : 698Mhz
     step3 : 606Mhz
Setting speed to 698720
Setting speed to 606000
Setting speed to 798720
Statistics:
  3 speed changes in 5 seconds
PowerNow Daemon Exiting.


I don't know if this little patch is suitable for Debian, because you've 
fixed the error handling in other places too;


Anyway, thanks for the effort!


-- Mourad





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to