From owner-freebsd-current@FreeBSD.ORG Wed Feb 2 21:29:45 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A543716A4CE; Wed, 2 Feb 2005 21:29:45 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A3B743D1D; Wed, 2 Feb 2005 21:29:45 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id j12LThWk000339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 2 Feb 2005 13:29:44 -0800 Message-ID: <42014644.9080603@root.org> Date: Wed, 02 Feb 2005 13:29:40 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Ducrot References: <41FFB53B.3020907@root.org> <42012739.9080501@freebsd.org> <42013223.4080704@root.org> <20050202203758.GY1145@poupinou.org> In-Reply-To: <20050202203758.GY1145@poupinou.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: acpi@freebsd.org cc: current@freebsd.org cc: Colin Percival Subject: Re: New cpufreq framework and drivers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2005 21:29:45 -0000 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