From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dominik Brodowski Subject: Re: Re: Linux ACPI processor driver patch: user-definable power state limit Date: Fri, 5 Nov 2004 23:54:38 +0100 Message-ID: <20041105225438.GA8262@dominikbrodowski.de> References: <200410112335.19159.jos.delbar@ugent.be> <1099683907.13837.1353.camel@d845pe> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1099683907.13837.1353.camel@d845pe> Sender: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Len Brown Cc: Jos Delbar , ACPI Developers , Robert Moore , James P Ketrenos List-Id: linux-acpi@vger.kernel.org On Fri, Nov 05, 2004 at 02:45:07PM -0500, Len Brown wrote: > Jos, > I agree with you that a single parameter is simpler. > > Another thing we need to address -- with either scheme -- > is that the parameter must be set in the kernel, not > in the processor modules. > > This is because it is necessary for modules, such as ipw2100 > to be able to disable c3 automatically when they detect > that it is interfering with their operation. > > so we'd export a function from the base kernel for > modules to set the limit, and we'd simply export > the value of acpi_cstate_limit for processor.c > to observe at run-time. > > int > acpi_set_cstate_limit(int limit) > > int acpi_cstate_limit; > > I think it can return the old limit so that > the caller can potentially un-do its call, > or perhaps setting the limit to 0 should > simply mean clear any limit. That sounds to be quite racy. Multiple callers will get confused. You probably need a struct acpi_cstate_limit { list_head next; unsigned int limit; } and you export struct *acpi_cstate_limimt acpi_set_cstate_limit(unsigned int limit); int acpi_modify_cstate_limit(struct acpi_cstate_limit * cstate_limit); void acpi_remove_cstate_limit(struct acpi_cstate_limit * cstate_limit); Whenever such an operation occurs, you need to walk all these limit structs for the highest "limit", and use that. Other than that, the current "limit" interface to processor.c seems to be pretty much useless as P-States aren't really handled. I'll cook up a patch for the thing above in a few minutes... stay tuned. Thanks, Dominik ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click