From owner-freebsd-acpi@FreeBSD.ORG Wed Apr 23 19:46:44 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0832D106564A for ; Wed, 23 Apr 2008 19:46:44 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id B2F278FC1C for ; Wed, 23 Apr 2008 19:46:43 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 37193 invoked from network); 23 Apr 2008 19:46:44 -0000 Received: from ppp-71-139-6-184.dsl.snfc21.pacbell.net (HELO ?10.0.5.18?) (nate-mail@71.139.6.184) by root.org with ESMTPA; 23 Apr 2008 19:46:44 -0000 Message-ID: <480F921D.3050505@root.org> Date: Wed, 23 Apr 2008 12:46:37 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Andriy Gapon References: <480F8E2E.8000502@icyb.net.ua> In-Reply-To: <480F8E2E.8000502@icyb.net.ua> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: initial value of tz_active X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 19:46:44 -0000 Andriy Gapon wrote: > It seems that tz_active (in acpi_thermal) is initialized to NONE/-1. > I don't have a patch, but I have an idea - acpi_thermal should query > current power state of fans and set tz_active based on that. > For example, some systems start up with all fans turned on (at full > speed) for safety reasons, acpi_thermal sees that temperature is low > enough, it thinks/assumes that no fan is active, so it doesn't change AC > level, so in reality AC0 is always in effect. Good point. I think there should be a "first_time" static that is set on boot. Once acpi_thermal decides to turn some fans on or off, first_time is set. Until it has been set, all fan control is actually performed, regardless of tz_active. After it is set, we can depend on tz_active as before. The reason we can't just read the fan status and initialize tz_active accordingly is that some ASL doesn't return the real value of the fans. It just returns a hard-coded value. On many systems, it does return the real value but if even one system is wrong, we can't trust any of them. -- Nate