From owner-freebsd-acpi@FreeBSD.ORG Sat Feb 16 03:12:10 2008 Return-Path: Delivered-To: acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4D316A418 for ; Sat, 16 Feb 2008 03:12:10 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from ameno.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4D83713C44B for ; Sat, 16 Feb 2008 03:12:10 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from kasuga.mahoroba.org (IDENT:bxqcBC0gXaVUVKf7d4rXbOT/GlvKCzTC+Zdd3sic4Iy9gg0rWKn1OQc1I4Z5OWbV@kasuga.mahoroba.org [IPv6:2001:2f0:104:8010:20b:97ff:fe2e:b521]) (user=ume mech=CRAM-MD5 bits=0) by ameno.mahoroba.org (8.13.8/8.13.8) with ESMTP/inet6 id m1G3C0av078894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Feb 2008 12:12:00 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sat, 16 Feb 2008 12:11:59 +0900 Message-ID: From: Hajimu UMEMOTO To: "Alexandre \"Sunny\" Kovalenko" In-Reply-To: <1203126071.833.19.camel@RabbitsDen> References: <20080208045605.15C874500E@ptavv.es.net> <47ABF402.7030904@root.org> <1202475519.7014.7.camel@RabbitsDen> <1203126071.833.19.camel@RabbitsDen> User-Agent: xcite1.57> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.1 (i386-pc-freebsd) MULE/5.0 (SAKAKI) X-Operating-System: FreeBSD 6.3-RELEASE-p1 X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (ameno.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sat, 16 Feb 2008 12:12:01 +0900 (JST) X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on ameno.mahoroba.org Cc: acpi@freebsd.org, Johannes Dieterich , Ian Smith Subject: Re: [RFC] Patch to enable temperature ceiling in powerd 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: Sat, 16 Feb 2008 03:12:10 -0000 Hi, >>>>> On Fri, 15 Feb 2008 20:41:10 -0500 >>>>> "Alexandre \"Sunny\" Kovalenko" said: alex> Thank you very much for pointing me in the right direction -- my system alex> (ThinkPad X60 1709-73U) does provide _TSP, _TC1 and _TC2, just not in alex> the tz0. All of that lives in tz1 and works perfectly -- as the matter alex> of fact I am writing this E-mail after setting alex> hw.acpi.thermal.tz1.passive_cooling: 1 alex> hw.acpi.thermal.user_override: 1 alex> hw.acpi.thermal.tz1._PSV: 55.0C The current implementation attempts to enable passive cooling just for tz0. Could you try the following patch? It should enable passive cooling for tz1 on your laptop. Index: sys/dev/acpica/acpi_thermal.c diff -u -p sys/dev/acpica/acpi_thermal.c.orig sys/dev/acpica/acpi_thermal.c --- sys/dev/acpica/acpi_thermal.c.orig Wed Aug 23 21:29:55 2006 +++ sys/dev/acpica/acpi_thermal.c Mon Aug 28 00:35:49 2006 @@ -172,6 +172,8 @@ static int acpi_tz_override; static struct proc *acpi_tz_proc; ACPI_LOCK_DECL(thermal, "ACPI thermal zone"); +static int acpi_tz_cooling_unit = -1; + static int acpi_tz_probe(device_t dev) { @@ -205,17 +207,7 @@ acpi_tz_attach(device_t dev) sc->tz_cooling_proc_running = FALSE; sc->tz_cooling_active = FALSE; sc->tz_cooling_updated = FALSE; - - /* - * Always attempt to enable passive cooling for tz0. Users can enable - * it for other zones manually for now. - * - * XXX We need to test if multiple zones conflict with each other - * since cpufreq currently sets all CPUs to the given frequency whereas - * it's possible for different thermal zones to specify independent - * settings for multiple CPUs. - */ - sc->tz_cooling_enabled = (device_get_unit(dev) == 0); + sc->tz_cooling_enabled = FALSE; /* * Parse the current state of the thermal zone and build control @@ -309,16 +301,25 @@ acpi_tz_attach(device_t dev) } } - /* Create a thread to handle passive cooling for each zone if enabled. */ + /* + * Create a thread to handle passive cooling for 1st zone which + * has _PSV, _TSP, _TC1 and _TC2. Users can enable it for other + * zones manually for now. + * + * XXX We enable only one zone to avoid multiple zones conflict + * with each other since cpufreq currently sets all CPUs to the + * given frequency whereas it's possible for different thermal + * zones to specify independent settings for multiple CPUs. + */ + if (acpi_tz_cooling_unit < 0 && acpi_tz_cooling_is_available(sc)) + sc->tz_cooling_enabled = TRUE; if (sc->tz_cooling_enabled) { - if (acpi_tz_cooling_is_available(sc)) { - error = acpi_tz_cooling_thread_start(sc); - if (error != 0) { - sc->tz_cooling_enabled = FALSE; - goto out; - } - } else + error = acpi_tz_cooling_thread_start(sc); + if (error != 0) { sc->tz_cooling_enabled = FALSE; + goto out; + } + acpi_tz_cooling_unit = device_get_unit(dev); } /* Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/