From andy@fud.org.nz  Mon Jan 19 14:19:47 2004
Return-Path: <andy@fud.org.nz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 39CC416A4CE; Mon, 19 Jan 2004 14:19:47 -0800 (PST)
Received: from smtp.fud.org.nz (203-79-110-29.cable.paradise.net.nz [203.79.110.29])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 1959443D2D; Mon, 19 Jan 2004 14:19:43 -0800 (PST)
	(envelope-from andy@fud.org.nz)
Received: by smtp.fud.org.nz (Postfix, from userid 1001)
	id D2410170A9; Tue, 20 Jan 2004 11:19:40 +1300 (NZDT)
Message-Id: <20040119221940.D2410170A9@smtp.fud.org.nz>
Date: Tue, 20 Jan 2004 11:19:40 +1300 (NZDT)
From: Andrew Thompson <andy@fud.org.nz>
Reply-To: Andrew Thompson <andy@fud.org.nz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: njl@freebsd.org
Subject: [PATCH] Reverse logic for user override in acpi_thermal.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         61592
>Category:       kern
>Synopsis:       [PATCH] Reverse logic for user override in acpi_thermal.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    njl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 19 14:20:08 PST 2004
>Closed-Date:    Fri Mar 05 10:10:09 PST 2004
>Last-Modified:  Fri Mar 05 10:10:09 PST 2004
>Originator:     Andrew Thompson
>Release:        FreeBSD 5.2-RC i386
>Organization:
>Environment:
System: FreeBSD kate.fud.org.nz 5.2-RC FreeBSD 5.2-RC #0: Sat Dec 13 00:52:30 NZDT 2003 andy@kate.fud.org.nz:/usr/obj/usr/src/sys/KATE i386


	
>Description:
A user can set tz_requested via the tzX.active sysctl. The thermal states sort 
from hot to cold where 0 has the most cooling power. (AFAIK :)

The current logic means that if a user sets it to a lower cooling (e.g 3) it 
will not go to 2,1 or 0 (more cooling). Essentially limiting the cooling.

I believe it should be the other way around, where tz_requested sets the
minimum cooling level, not maximum. patch attached.

>How-To-Repeat:
>Fix:


--- sys/dev/acpica/acpi_thermal.c.orig  Tue Jan 20 11:07:24 2004
+++ sys/dev/acpica/acpi_thermal.c       Tue Jan 20 11:06:42 2004
@@ -436,7 +436,7 @@
     }
 
     /* Handle user override of active mode */
-    if (sc->tz_requested > newactive)
+    if (sc->tz_requested != TZ_ACTIVE_NONE && sc->tz_requested < newactive)
        newactive = sc->tz_requested;
 
     /* update temperature-related flags */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: njl 
State-Changed-When: Fri Mar 5 10:09:12 PST 2004 
State-Changed-Why:  
Thanks.  In the future, please submit patches directly to the 
acpi-jp@jp.freebsd.org list or discuss problems there.  We'll direct 
you to enter a PR if it's an issue that needs to be tracked. 


Responsible-Changed-From-To: freebsd-bugs->njl 
Responsible-Changed-By: njl 
Responsible-Changed-When: Fri Mar 5 10:09:12 PST 2004 
Responsible-Changed-Why:  
Thanks.  In the future, please submit patches directly to the 
acpi-jp@jp.freebsd.org list or discuss problems there.  We'll direct 
you to enter a PR if it's an issue that needs to be tracked. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61592 
>Unformatted:
