From owner-freebsd-acpi@FreeBSD.ORG Thu Jul 12 12:35:04 2012 Return-Path: Delivered-To: acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 070001065672; Thu, 12 Jul 2012 12:35:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id CA62E8FC16; Thu, 12 Jul 2012 12:35:03 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27AE0B91E; Thu, 12 Jul 2012 08:35:03 -0400 (EDT) From: John Baldwin To: freebsd-amd64@freebsd.org Date: Thu, 12 Jul 2012 07:40:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207110248.q6B2mplM078753@red.freebsd.org> In-Reply-To: <201207110248.q6B2mplM078753@red.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201207120740.09379.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 Jul 2012 08:35:03 -0400 (EDT) Cc: acpi@freebsd.org, freebsd-gnats-submit@freebsd.org, Axel Gonzalez Subject: Re: amd64/169779: [patch] powerd doesn't honor the -n flag 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: Thu, 12 Jul 2012 12:35:04 -0000 On Tuesday, July 10, 2012 10:48:51 pm Axel Gonzalez wrote: > > >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; I suspect this is correct, but cc'ing acpi@ to see if anyone there has any comments. -- John Baldwin