From owner-freebsd-acpi@FreeBSD.ORG Thu Dec 16 18:05:30 2010 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 9CFF31065693; Thu, 16 Dec 2010 18:05:30 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9D48FC1E; Thu, 16 Dec 2010 18:05:29 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA11353; Thu, 16 Dec 2010 20:05:27 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4D0A54E6.40105@icyb.net.ua> Date: Thu, 16 Dec 2010 20:05:26 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: bug-followup@FreeBSD.org, y.skripachov@gmail.com, freebsd-acpi@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: kern/124744: [acpi] [patch] incorrect _BST result validation for Tosh Satellite P20 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, 16 Dec 2010 18:05:30 -0000 I think that the patch is good and I have slightly extended it: http://people.freebsd.org/~avg/acpi-bat.diff Part of the problem is that the same definitions are used for interpreting status returned by _BST and for maintaining internal driver status. I have added a comment that explains this duality, retired now unused ACPI_BATT_STAT_MAX, added code for cleaning extended/undefined bits in _BST status and added a warning about charging+discharging bits being set at the same time. I'd appreciate reviews and testing. Thanks! -- Andriy Gapon