From owner-freebsd-amd64@FreeBSD.ORG Wed Jul 11 02:50:11 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D95211065674 for ; Wed, 11 Jul 2012 02:50:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 946E88FC0C for ; Wed, 11 Jul 2012 02:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6B2oBsj018584 for ; Wed, 11 Jul 2012 02:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6B2oB4R018583; Wed, 11 Jul 2012 02:50:11 GMT (envelope-from gnats) Resent-Date: Wed, 11 Jul 2012 02:50:11 GMT Resent-Message-Id: <201207110250.q6B2oB4R018583@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Axel Gonzalez Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19AAA106564A for ; Wed, 11 Jul 2012 02:48:52 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 044288FC08 for ; Wed, 11 Jul 2012 02:48:52 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6B2mper078754 for ; Wed, 11 Jul 2012 02:48:51 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6B2mplM078753; Wed, 11 Jul 2012 02:48:51 GMT (envelope-from nobody) Message-Id: <201207110248.q6B2mplM078753@red.freebsd.org> Date: Wed, 11 Jul 2012 02:48:51 GMT From: Axel Gonzalez To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Wed, 11 Jul 2012 02:55:41 +0000 Cc: Subject: amd64/169779: [patch] powerd doesn't honor the -n flag X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 02:50:12 -0000 >Number: 169779 >Category: amd64 >Synopsis: [patch] powerd doesn't honor the -n flag >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 11 02:50:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Axel Gonzalez >Release: 9.0-RELEASE-p2 >Organization: >Environment: FreeBSD moonlight 9.0-RELEASE-p2 FreeBSD 9.0-RELEASE-p2 #0: Tue Jun 12 02:12:57 CDT 2012 toor@moonlight:/usr/obj/usr/src/sys/LXCORE964 amd64 >Description: powerd never initializes the variable that keeps the status of the line status. This variable defaults to 0 (with the compiler? with the arch?) and results in powerd using the AC profile. This is a problem, since at start it says it is in unkown status, but doesn't respect the -n argument. Note: since the variable is not initialized, it can lead to other unexpected behaviour. >How-To-Repeat: This should use the "adaptive" profile specified by -n, but uses hiadaptive # /usr/sbin/powerd -i 50 -r 80 -M 1800 -v -p 1000 -n adaptive powerd: unable to determine AC line status CPU frequency is above user-defined maximum; changing frequency to 1795 MHz load 15%, current freq 1795 MHz ( 0), wanted freq 2094 MHz >Fix: Initialize the variable --- powerd.c.orig 2012-07-10 21:21:07.882970887 -0500 +++ powerd.c 2012-07-10 21:22:29.292974203 -0500 @@ -278,6 +278,7 @@ acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; >Release-Note: >Audit-Trail: >Unformatted: