Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Feb 2005 13:29:40 -0800
From:      Nate Lawson <nate@root.org>
To:        Bruno Ducrot <ducrot@poupinou.org>
Cc:        Colin Percival <cperciva@freebsd.org>
Subject:   Re: New cpufreq framework and drivers
Message-ID:  <42014644.9080603@root.org>
In-Reply-To: <20050202203758.GY1145@poupinou.org>
References:  <41FFB53B.3020907@root.org> <42012739.9080501@freebsd.org> <42013223.4080704@root.org> <20050202203758.GY1145@poupinou.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruno Ducrot wrote:
> On Wed, Feb 02, 2005 at 12:03:47PM -0800, Nate Lawson wrote:
> 
>>Colin Percival wrote:
>>
>>>Nate Lawson wrote:
>>>
>>>
>>>>Hardware drivers are of two types, absolute
>>>>and relative.  SpeedStep, Powernow, etc. are absolute drivers in that 
>>>>they set the cpu's base frequency.  ACPI throttling, Longrun, etc. are 
>>>>relative drivers that reduce the processor's clock to a fraction of 
>>>>its current base (i.e., they have an additive effect.)
>>>
>>>
>>>If my first glance at the patch is correct, this would have my laptop (a 
>>>1.4GHz
>>>Pentium M) reporting the availability of the frequencies 600MHz, 800MHz, 
>>>etc.
>>
>>>from enhanced speedstep, along with the frequencies 300MHz, 400MHz, 
>>
>>>500MHz, and
>>>700MHz obtained via 50% clock throttling.
>>
>>That is correct.  The code to support relative drivers was removed 
>>before posting to give the basic framework more testing before I commit 
>>it shortly.  The relative support will go in soon after that code is 
>>committed.
>>
> 
> But longrun is relative though and can scale voltage.
> (And the point that longrun can control frequency itself is imho irrelevant).

If you look at struct cf_setting, the "freq" field is either the 
absolute freq in Mhz (i.e. 700 = 700 Mhz) or a relative percentage (i.e. 
50 = 50% clock reduction).  The way you tell the difference is that the 
CPUFREQ_DRV_SETTINGS() method returns a "type", which is either absolute 
or relative.

All the other fields are valid for both types so your driver would set 
the "volt" field of cf_setting to whatever Longrun says.)  If your 
driver somehow knew the power consumed for that setting, it could supply 
that info too.  Otherwise, set CPUFREQ_VAL_UNKNOWN for each value not 
known by the driver.

(BTW, I'm moving relative units to hundredths of a percent, i.e. 8055 = 
80.55%)

-- 
Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42014644.9080603>