Subject: Re: Status report: sysmon_cpufreq(9) + powerctl(8)
To: Iain Hibbert <plunky@rya-online.net>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 09/29/2006 01:40:08
On Thu, 28 Sep 2006 23:13:20 +0100 (BST)
Iain Hibbert <plunky@rya-online.net> wrote:

> On Thu, 28 Sep 2006, Juan RP wrote:
> 
> > I changed it to DEV_PROP_D(x)	device_properties(x)
> 
> For me, I would just use device_properties(x) directly :)
> 
> > Thanks for all these comments, I've updated the code both kernel and
> > userland.
> 
> more comments attached :)

HAHA, you rock. It works!

I had to call sysmon_cpufreq_recv_data if freqfound is TRUE to refresh 
curfreq value and recreate the dictionary.

[juan@nocturno][~]> ./powerctl
(cpufreq-lkm)
        current:        1400 MHz [470 mV]
        frequencies:    800 1000 1200 1400 1600 1800 (in MHz)
(cpufreq2-lkm)
        current:        1067 MHz [1803 mV]
        frequencies:    800 1067 1333 1600 1867 2133 (in MHz)
[juan@nocturno][~]>

[juan@nocturno][~]> ./powerctl -d cpufreq2-lkm -f 2133
set_newfreq: drvname=cpufreq2-lkm
(cpufreq2-lkm) 1067 -> 2133
[juan@nocturno][~]>

[juan@nocturno][~]> ./powerctl -d cpufreq-lkm -f 1800 
set_newfreq: drvname=cpufreq-lkm
(cpufreq-lkm) 2133 -> 1800
[juan@nocturno][~]>

[juan@nocturno][~]> ./powerctl                        
(cpufreq-lkm)
        current:        1800 MHz [470 mV]
        frequencies:    800 1000 1200 1400 1600 1800 (in MHz)
(cpufreq2-lkm)
        current:        2133 MHz [1803 mV]
        frequencies:    800 1067 1333 1600 1867 2133 (in MHz)
[juan@nocturno][~]>

Patch updated... I think I fixed all the things you said, please
correct me if I'm missing something.